diff options
author | Michele Marchetto <michele@cvs.openbsd.org> | 2006-10-31 23:43:12 +0000 |
---|---|---|
committer | Michele Marchetto <michele@cvs.openbsd.org> | 2006-10-31 23:43:12 +0000 |
commit | 4408b82564117ed0494a4eeabda5de5816253ac9 (patch) | |
tree | 83c457f59b1dc1e1fd8dcae02cc425e02b0f9d6f /usr.sbin/ripd/packet.c | |
parent | 01d8e5adac204b0f22bfcf990eff272b66f45444 (diff) |
create a temporary neighbor instead of a permanent one when a request is received
Diffstat (limited to 'usr.sbin/ripd/packet.c')
-rw-r--r-- | usr.sbin/ripd/packet.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/usr.sbin/ripd/packet.c b/usr.sbin/ripd/packet.c index 50a9ba6f789..e39bc20dae0 100644 --- a/usr.sbin/ripd/packet.c +++ b/usr.sbin/ripd/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.3 2006/10/24 16:37:48 david Exp $ */ +/* $OpenBSD: packet.c,v 1.4 2006/10/31 23:43:11 michele Exp $ */ /* * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> @@ -165,19 +165,14 @@ recv_packet(int fd, short event, void *bula) /* switch RIP command */ switch (rip_hdr->command) { case COMMAND_REQUEST: + /* Requests don't create a real neighbor, just a temporary + * one to build the response. + */ if ((msg.msg_flags & MSG_MCAST) == 0 && srcport == RIP_PORT) return; - /* XXX: it would be better to not create a nbr on request - * because this could lead to DoS even on a authenticated - * environment. - */ if (nbr == NULL) { nbr = nbr_new(src.sin_addr.s_addr, iface, 0); - if (nbr_failed != NULL) { - nbr->auth_seq_num = nbr_failed->auth_seq_num; - nbr_failed_delete(iface, nbr_failed); - } nbr->addr = src.sin_addr; } nbr->port = srcport; |