diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-06-22 10:59:34 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-06-22 10:59:34 +0000 |
commit | 3c02410d55d9cfe0cb4dcbfad5eef376463d8e08 (patch) | |
tree | 45a4f946feeb75c5ed5e8dcc028809c6966e1ba1 /sys/dev/cxgb | |
parent | 0b01d8c2101aa4512c45bd77f2c3fee5137b4595 (diff) | |
download | FreeBSD-src-3c02410d55d9cfe0cb4dcbfad5eef376463d8e08.zip FreeBSD-src-3c02410d55d9cfe0cb4dcbfad5eef376463d8e08.tar.gz |
Add a new function, ifa_ifwithaddr_check(), which rather than returning
a pointer to an ifaddr matching the passed socket address, returns a
boolean indicating whether one was present. In the (near) future,
ifa_ifwithaddr() will return a referenced ifaddr rather than a raw
ifaddr pointer, and the new wrapper will allow callers that care only
about the boolean condition to avoid having to free that reference.
MFC after: 3 weeks
Diffstat (limited to 'sys/dev/cxgb')
-rw-r--r-- | sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c b/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c index 83b1b0d..c582dbd 100644 --- a/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c +++ b/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c @@ -1337,12 +1337,13 @@ static int is_loopback_dst(struct iw_cm_id *cm_id) { uint16_t port = cm_id->remote_addr.sin_port; - struct ifaddr *ifa; + int ifa_present; cm_id->remote_addr.sin_port = 0; - ifa = ifa_ifwithaddr((struct sockaddr *)&cm_id->remote_addr); + ifa_present = ifa_ifwithaddr_check( + (struct sockaddr *)&cm_id->remote_addr); cm_id->remote_addr.sin_port = port; - return (ifa != NULL); + return (ifa_present); } int |