mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 23:54:22 +01:00
gossipd: don't try to handle padding inside fromwire_ipaddr.
It makes it impossible to embed an ipaddr in another structure, since we always try to skip over any zeroes, which may swallow a following field. Do the skip specially for the case where we're parsing routing messages: we never use padding for our own internal messages anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
c2dd0cb295
commit
7e022b522c
@@ -637,6 +637,10 @@ static struct ipaddr *read_addresses(const tal_t *ctx, const u8 *ser)
|
||||
while (cursor && cursor < ser + max) {
|
||||
struct ipaddr ipaddr;
|
||||
|
||||
/* Skip any padding */
|
||||
while (max && cursor[0] == ADDR_TYPE_PADDING)
|
||||
fromwire_u8(&cursor, &max);
|
||||
|
||||
/* BOLT #7:
|
||||
*
|
||||
* The receiving node SHOULD ignore the first `address
|
||||
|
||||
Reference in New Issue
Block a user