Piotr Durlej <[email protected]> writes:
[...]
> Any thoughts? Is the patch ok, wrong, accepted, rejected or unnoticed?
Your diff wouldn't apply because of mangled whitespace (please don't
copy/paste diffs). Here's an updated diff below (untested).
Index: packet.c
===================================================================
RCS file: /d/cvs/src/usr.sbin/ripd/packet.c,v
retrieving revision 1.12
diff -u -p -p -u -r1.12 packet.c
--- packet.c 25 Oct 2014 03:23:49 -0000 1.12
+++ packet.c 13 Dec 2016 19:16:27 -0000
@@ -232,15 +232,17 @@ find_iface(struct ripd_conf *xconf, unsi
/* returned interface needs to be active */
LIST_FOREACH(iface, &xconf->iface_list, entry) {
- if (ifindex != 0 && ifindex == iface->ifindex &&
- !iface->passive && (iface->addr.s_addr &
- iface->mask.s_addr) == (src.s_addr & iface->mask.s_addr))
- /*
- * XXX may fail on P2P links because src and dst don't
- * have to share a common subnet on the otherhand
- * checking something like this will help to support
- * multiple networks configured on one interface.
- */
+ if (ifindex == 0 || ifindex != iface->ifindex)
+ continue;
+
+ if (iface->passive)
+ continue;
+
+ if ((iface->addr.s_addr & iface->mask.s_addr) ==
+ (src.s_addr & iface->mask.s_addr))
+ return (iface);
+
+ if (iface->dst.s_addr && iface->dst.s_addr == src.s_addr)
return (iface);
}
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE