diff options
author | 2005-01-20 17:47:38 +0000 | |
---|---|---|
committer | 2005-01-20 17:47:38 +0000 | |
commit | 3ca896aff6da3263e6393cc76edc1ea255f460c8 (patch) | |
tree | 85c7f67ae202fd4750c992ef260af3734db131f5 | |
parent | add /usr/libdata/ldscripts/ (diff) | |
download | wireguard-openbsd-3ca896aff6da3263e6393cc76edc1ea255f460c8.tar.xz wireguard-openbsd-3ca896aff6da3263e6393cc76edc1ea255f460c8.zip |
Use syncdev instead of syncif in ifconfig, and modify ioctl struct pfsyncreq
in kernel code to match. Brings pfsync in line with carp, vlan and pppoe
devices. Old syncif and -syncif options still work, will be removed later.
ok markus@
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 28 | ||||
-rw-r--r-- | sys/net/if_pfsync.c | 8 | ||||
-rw-r--r-- | sys/net/if_pfsync.h | 4 |
3 files changed, 21 insertions, 19 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index c2abb50d77a..d28f28f9f45 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.129 2005/01/18 21:51:14 claudio Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.130 2005/01/20 17:47:38 mcbride Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -77,7 +77,7 @@ static const char copyright[] = #if 0 static const char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94"; #else -static const char rcsid[] = "$OpenBSD: ifconfig.c,v 1.129 2005/01/18 21:51:14 claudio Exp $"; +static const char rcsid[] = "$OpenBSD: ifconfig.c,v 1.130 2005/01/20 17:47:38 mcbride Exp $"; #endif #endif /* not lint */ @@ -209,9 +209,9 @@ void setcarp_vhid(const char *, int); void setcarp_state(const char *, int); void setcarpdev(const char *, int); void unsetcarpdev(const char *, int); -void setpfsync_syncif(const char *, int); +void setpfsync_syncdev(const char *, int); void setpfsync_maxupd(const char *, int); -void unsetpfsync_syncif(const char *, int); +void unsetpfsync_syncdev(const char *, int); void setpfsync_syncpeer(const char *, int); void unsetpfsync_syncpeer(const char *, int); void pfsync_status(void); @@ -313,8 +313,10 @@ const struct cmd { { "state", NEXTARG, 0, setcarp_state }, { "carpdev", NEXTARG, 0, setcarpdev }, { "-carpdev", 1, 0, unsetcarpdev }, - { "syncif", NEXTARG, 0, setpfsync_syncif }, - { "-syncif", 1, 0, unsetpfsync_syncif }, + { "syncdev", NEXTARG, 0, setpfsync_syncdev }, + { "-syncdev", 1, 0, unsetpfsync_syncdev }, + { "syncif", NEXTARG, 0, setpfsync_syncdev }, + { "-syncif", 1, 0, unsetpfsync_syncdev }, { "syncpeer", NEXTARG, 0, setpfsync_syncpeer }, { "-syncpeer", 1, 0, unsetpfsync_syncpeer }, { "maxupd", NEXTARG, 0, setpfsync_maxupd }, @@ -2853,7 +2855,7 @@ unsetcarpdev(const char *val, int d) } void -setpfsync_syncif(const char *val, int d) +setpfsync_syncdev(const char *val, int d) { struct pfsyncreq preq; @@ -2863,7 +2865,7 @@ setpfsync_syncif(const char *val, int d) if (ioctl(s, SIOCGETPFSYNC, (caddr_t)&ifr) == -1) err(1, "SIOCGETPFSYNC"); - strlcpy(preq.pfsyncr_syncif, val, sizeof(preq.pfsyncr_syncif)); + strlcpy(preq.pfsyncr_syncdev, val, sizeof(preq.pfsyncr_syncdev)); if (ioctl(s, SIOCSETPFSYNC, (caddr_t)&ifr) == -1) err(1, "SIOCSETPFSYNC"); @@ -2871,7 +2873,7 @@ setpfsync_syncif(const char *val, int d) /* ARGSUSED */ void -unsetpfsync_syncif(const char *val, int d) +unsetpfsync_syncdev(const char *val, int d) { struct pfsyncreq preq; @@ -2881,7 +2883,7 @@ unsetpfsync_syncif(const char *val, int d) if (ioctl(s, SIOCGETPFSYNC, (caddr_t)&ifr) == -1) err(1, "SIOCGETPFSYNC"); - bzero((char *)&preq.pfsyncr_syncif, sizeof(preq.pfsyncr_syncif)); + bzero((char *)&preq.pfsyncr_syncdev, sizeof(preq.pfsyncr_syncdev)); if (ioctl(s, SIOCSETPFSYNC, (caddr_t)&ifr) == -1) err(1, "SIOCSETPFSYNC"); @@ -2972,8 +2974,8 @@ pfsync_status(void) if (ioctl(s, SIOCGETPFSYNC, (caddr_t)&ifr) == -1) return; - if (preq.pfsyncr_syncif[0] != '\0') { - printf("\tpfsync: syncif: %s ", preq.pfsyncr_syncif); + if (preq.pfsyncr_syncdev[0] != '\0') { + printf("\tpfsync: syncdev: %s ", preq.pfsyncr_syncdev); if (preq.pfsyncr_syncpeer.s_addr != INADDR_PFSYNC_GROUP) printf("syncpeer: %s ", inet_ntoa(preq.pfsyncr_syncpeer)); @@ -3309,7 +3311,7 @@ usage(int value) "\t[vlan vlan_tag vlandev parent_iface] [-vlandev] [vhid n]\n" "\t[advbase n] [advskew n] [maxupd n] [pass passphrase]\n" "\t[state init | backup | master]\n" - "\t[syncif iface] [-syncif] [syncpeer peer_address] [-syncpeer]\n" + "\t[syncdev iface] [-syncdev] [syncpeer peer_address] [-syncpeer]\n" "\t[phase n] [range netrange] [timeslot timeslot_range]\n" "\t[802.2] [802.2tr] [802.3] [snap] [EtherII]\n" "\t[pppoeac access-concentrator] [-pppoeac]\n" diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c index 9a32c528161..37a739606ae 100644 --- a/sys/net/if_pfsync.c +++ b/sys/net/if_pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.c,v 1.42 2004/12/16 00:45:34 mcbride Exp $ */ +/* $OpenBSD: if_pfsync.c,v 1.43 2005/01/20 17:47:38 mcbride Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -768,7 +768,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCGETPFSYNC: bzero(&pfsyncr, sizeof(pfsyncr)); if (sc->sc_sync_ifp) - strlcpy(pfsyncr.pfsyncr_syncif, + strlcpy(pfsyncr.pfsyncr_syncdev, sc->sc_sync_ifp->if_xname, IFNAMSIZ); pfsyncr.pfsyncr_syncpeer = sc->sc_sync_peer; pfsyncr.pfsyncr_maxupdates = sc->sc_maxupdates; @@ -791,7 +791,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) return (EINVAL); sc->sc_maxupdates = pfsyncr.pfsyncr_maxupdates; - if (pfsyncr.pfsyncr_syncif[0] == 0) { + if (pfsyncr.pfsyncr_syncdev[0] == 0) { sc->sc_sync_ifp = NULL; if (sc->sc_mbuf_net != NULL) { /* Don't keep stale pfsync packets around. */ @@ -808,7 +808,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; } - if ((sifp = ifunit(pfsyncr.pfsyncr_syncif)) == NULL) + if ((sifp = ifunit(pfsyncr.pfsyncr_syncdev)) == NULL) return (EINVAL); s = splnet(); diff --git a/sys/net/if_pfsync.h b/sys/net/if_pfsync.h index ffd2a8fa029..ddd049a81fd 100644 --- a/sys/net/if_pfsync.h +++ b/sys/net/if_pfsync.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.h,v 1.18 2004/12/14 13:41:01 mickey Exp $ */ +/* $OpenBSD: if_pfsync.h,v 1.19 2005/01/20 17:47:38 mcbride Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -221,7 +221,7 @@ struct pfsyncstats { * Configuration structure for SIOCSETPFSYNC SIOCGETPFSYNC */ struct pfsyncreq { - char pfsyncr_syncif[IFNAMSIZ]; + char pfsyncr_syncdev[IFNAMSIZ]; struct in_addr pfsyncr_syncpeer; int pfsyncr_maxupdates; int pfsyncr_authlevel; |