[PATCH] fix src address for rip with IPv4
This patch fixes RIP under Linux with IPv4 (IPv6 not tested). RIP could not send packets under Linux/IPv4 because the source address was set to the multicast destination address or the broadcast address respectively. This resulted in the following error when sending out the first packet: Unexpected error at rip transmit: Invalid argument Eventually no RIP packet could leave the host. Signed-off-by: Roman Hoog Antink <rha@open.ch> --- proto/rip/rip.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/proto/rip/rip.c b/proto/rip/rip.c index 0259cfb..a17228d 100644 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@ -709,15 +709,13 @@ new_iface(struct proto *p, struct iface *new, unsigned long flags, struct iface_ if (rif->multicast) { #ifndef IPV6 rif->sock->daddr = ipa_from_u32(0xe0000009); - rif->sock->saddr = ipa_from_u32(0xe0000009); #else rif->sock->daddr = ipa_build(0xff020000, 0, 0, 9); - rif->sock->saddr = new->addr->ip; #endif } else { rif->sock->daddr = new->addr->brd; - rif->sock->saddr = new->addr->brd; } + rif->sock->saddr = new->addr->ip; } if (!ipa_nonzero(rif->sock->daddr)) { -- 1.7.4.1
Hi there As it turns out, my patch only fixes sending of RIP packets. Reception of multicast RIP (at least under Linux) is still broken. Cheers, Roman On 21/10/11 16:43, Roman Hoog Antink wrote:
This patch fixes RIP under Linux with IPv4 (IPv6 not tested).
RIP could not send packets under Linux/IPv4 because the source address was set to the multicast destination address or the broadcast address respectively. This resulted in the following error when sending out the first packet: Unexpected error at rip transmit: Invalid argument Eventually no RIP packet could leave the host.
Signed-off-by: Roman Hoog Antink <rha@open.ch> --- proto/rip/rip.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/proto/rip/rip.c b/proto/rip/rip.c index 0259cfb..a17228d 100644 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@ -709,15 +709,13 @@ new_iface(struct proto *p, struct iface *new, unsigned long flags, struct iface_ if (rif->multicast) { #ifndef IPV6 rif->sock->daddr = ipa_from_u32(0xe0000009); - rif->sock->saddr = ipa_from_u32(0xe0000009); #else rif->sock->daddr = ipa_build(0xff020000, 0, 0, 9); - rif->sock->saddr = new->addr->ip; #endif } else { rif->sock->daddr = new->addr->brd; - rif->sock->saddr = new->addr->brd; } + rif->sock->saddr = new->addr->ip; } if (!ipa_nonzero(rif->sock->daddr)) {
Hi there I fixed RIP with IPv4 on Linux for both versions of RIP (broadcast and multicast). The difference to my previous patch is, now both transmission and reception work. Cheers, Roman On 21/10/11 16:43, Roman Hoog Antink wrote:
RIP could not send packets under Linux/IPv4 because the source address was set to the multicast destination address or the broadcast address respectively. This resulted in the following error when sending out the first packet: Unexpected error at rip transmit: Invalid argument Eventually no RIP packet could leave the host.
On Wed, Oct 26, 2011 at 04:58:09PM +1100, Roman Hoog Antink wrote:
Hi there
I fixed RIP with IPv4 on Linux for both versions of RIP (broadcast and multicast).
The difference to my previous patch is, now both transmission and reception work.
Thanks, merged. -- Elen sila lumenn' omentielvo Ondrej 'SanTiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
participants (2)
-
Ondrej Zajicek -
Roman Hoog Antink