commit 104d91a3cf038b063badcdd2bb11966cede4604a
Author: Roman Hoog Antink <rha@open.ch>
Date:   Wed Oct 26 14:42:48 2011 +1100

    fix RIP with IPv4 for Linux
    
    RIP could neither receive nor send packets under Linux/IPv4 because
    of wrong source and bind address when creating the UDP socket.
    
    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. And neither multicast
    nor broadcast (RIP v1) could be received.

diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index 0259cfb..fe26ac4 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -709,14 +709,18 @@ 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);
+      rif->sock->saddr = ipa_from_u32(INADDR_ANY);
 #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;
+#ifndef IPV6
+      rif->sock->saddr = ipa_from_u32(INADDR_ANY);
+#else
+      rif->sock->saddr = new->addr->ip;
+#endif
     }
   }
 
