diff options
author | luigi <luigi@FreeBSD.org> | 2004-04-13 11:24:43 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2004-04-13 11:24:43 +0000 |
commit | ce58934c26f217ac83da72bdcf78eaadc9efd26a (patch) | |
tree | 9052f7eca84644eb4dba0e247dc8a60e741b5b4f /sbin/natd/natd.c | |
parent | f83ca5e62d50a0c97e6da783970932ec1865b591 (diff) | |
download | FreeBSD-src-ce58934c26f217ac83da72bdcf78eaadc9efd26a.zip FreeBSD-src-ce58934c26f217ac83da72bdcf78eaadc9efd26a.tar.gz |
Replace ROUNDUP/ADVANCE with SA_SIZE
Diffstat (limited to 'sbin/natd/natd.c')
-rw-r--r-- | sbin/natd/natd.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/sbin/natd/natd.c b/sbin/natd/natd.c index f8ba6a6..67fff80 100644 --- a/sbin/natd/natd.c +++ b/sbin/natd/natd.c @@ -756,13 +756,9 @@ SetAliasAddressFromIfName(const char *ifn) int i; char *cp = (char *)(ifam + 1); -#define ROUNDUP(a) \ - ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) -#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len)) - for (i = 1; i < RTA_IFA; i <<= 1) if (ifam->ifam_addrs & i) - ADVANCE(cp, (struct sockaddr *)cp); + cp += SA_SIZE((struct sockaddr *)cp); if (((struct sockaddr *)cp)->sa_family == AF_INET) { sin = (struct sockaddr_in *)cp; break; |