version 1.1, 2012/02/21 22:39:10
|
version 1.1.1.2, 2016/11/02 10:45:58
|
Line 1
|
Line 1
|
/* $NetBSD: grabmyaddr.c,v 1.28 2011/03/14 17:18:12 tteras Exp $ */ | /* $NetBSD: grabmyaddr.c,v 1.28.2.2 2013/04/12 09:53:52 tteras Exp $ */ |
/* |
/* |
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. |
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. |
* Copyright (C) 2008 Timo Teras <timo.teras@iki.fi>. |
* Copyright (C) 2008 Timo Teras <timo.teras@iki.fi>. |
Line 274 myaddr_getsport(addr)
|
Line 274 myaddr_getsport(addr)
|
struct sockaddr *addr; |
struct sockaddr *addr; |
{ |
{ |
struct myaddr *my; |
struct myaddr *my; |
|
int port = 0, wport; |
|
|
LIST_FOREACH(my, &opened, chain) { |
LIST_FOREACH(my, &opened, chain) { |
if (cmpsaddr((struct sockaddr *) &my->addr, addr) <= CMPSADDR_WILDPORT_MATCH) | switch (cmpsaddr((struct sockaddr *) &my->addr, addr)) { |
| case CMPSADDR_MATCH: |
return extract_port((struct sockaddr *) &my->addr); |
return extract_port((struct sockaddr *) &my->addr); |
|
case CMPSADDR_WILDPORT_MATCH: |
|
wport = extract_port((struct sockaddr *) &my->addr); |
|
if (port == 0 || wport < port) |
|
port = wport; |
|
break; |
|
} |
} |
} |
|
|
|
if (port == 0) |
|
port = PORT_ISAKMP; |
|
|
return PORT_ISAKMP; | return port; |
} |
} |
|
|
void |
void |
Line 753 kernel_handle_message(msg)
|
Line 764 kernel_handle_message(msg)
|
case RTM_ADD: |
case RTM_ADD: |
case RTM_DELETE: |
case RTM_DELETE: |
case RTM_CHANGE: |
case RTM_CHANGE: |
|
case RTM_GET: |
case RTM_MISS: |
case RTM_MISS: |
case RTM_IFINFO: |
case RTM_IFINFO: |
#ifdef RTM_OIFINFO |
#ifdef RTM_OIFINFO |
Line 768 kernel_handle_message(msg)
|
Line 780 kernel_handle_message(msg)
|
break; |
break; |
default: |
default: |
plog(LLV_WARNING, LOCATION, NULL, |
plog(LLV_WARNING, LOCATION, NULL, |
"unrecognized route message with rtm_type: %d", | "unrecognized route message with rtm_type: %d\n", |
rtm->rtm_type); |
rtm->rtm_type); |
break; |
break; |
} |
} |