summaryrefslogtreecommitdiff
path: root/sbin/ifconfig
AgeCommit message (Collapse)Author
2020-11-06Keep track of allowed ips pointer correctlykn
Someone reported wg(4) not working on macppc; fix ifconfig(8)'s "wgaip" to interate over data structures in the same way as the kernel does. Analysis and fiff from Jason A. Donenfeld Tested on macppc, sparc64 and amd64 by me
2020-10-07Fix display of P2P link to be consistent over all AF.denis
OK kn@, input from claudio@
2020-10-07Reverse previous, needs discussion.denis
2020-10-07Fix display of P2P link to be consistent over all AF.denis
2020-09-15umb(4) shows the speed of the LTE connection but misses the b in Mbps.Claudio Jeker
OK kettenis@
2020-08-24some tweaks to the "group" text, from evan silberman;Jason McIntyre
i replaced the suggested Cm/Ql mix with simple Dq;
2020-08-24Omit common ifconfig optionskn
ifconfig(8)'s TRUNK (LINK AGGREGATION) nicely combines the two drivers, so omit common stuff from the drives specific manuals. This aids in the overall design of having options documented in ifconfig(8) alone unless they're inherently driver specific, e.g. "trunkproto" which stays in trunk(4). OK jmc
2020-08-08Replace strto*l(3) with strtonum(3)kn
Some bridge options allow values bigger than the corresponding datatype and thus pass overflowed values to the kernel, not all options to range checks and setting invalid "portno" complains about "portidx" values. Use the same, simpler strtonum() idiom across all options with consistent error messages and proper [U]INT*_MAX defines as max values to match the datatype and all option handlers to be consistent (in less code). Keep deferring option dependent min/max value checking to the ioctl(2) interface, i.e. values documented in ifconfig(8) are not duplicated in strtonum() calls. OK millert
2020-08-08add some vertical whitespace;Jason McIntyre
2020-08-05Move TPMR section above TRUNK to sort alphabeticallykn
Reminded by jmc
2020-08-05Document tpmr ioctls and synopsiskn
Add missing TPMR section to ifconfig(8) by moving the commands from the driver's manual to it (copy/paste) and document the ioctl(2) interface in tpmr(4). Indenting tpmr's first EXAMPLE while here; from jmc. OK jmc
2020-08-05Print tpmr(4) memberskn
tpmr is a trivial bridge and has no specific ioctls, so to distinguish it from the rest we must rely on the interface name; assuming that it is tpmr because neither is_bridge() nor is_switch() return success is not possible due to the way ifconfig is designed: it runs all *_status() commands for all interface types. OK dlg
2020-08-05Merge switch_status() into bridge_status()kn
This is to reduce duplicate code and prepare for bridge_status() to cover all bridge like interfaces: bridge(4), switch(4) and tpmr(4). OK dlg
2020-07-29Remove redundant bridge checkskn
bridge_status() and switch_status() do the regular sanity check with SIOCGIFFLAGS, but both functions also call is_switch() and bridge_status() also calls is_bridge(). is_bridge() checks SIOCGIFFLAGS again, then both is_*() helpers finally do driver specific ioctl(2) calls to test whether the given interface is indeed a bridge(4) or a switch(4). SIOCGIFFLAGS serves no purpose here and is taken care of in ifconfig.c's getinfo(), so remove its calls from brconfig.c entirely. OK dlg
2020-07-26Document aggr(4) in the TRUNK sectionkn
Complete the synopsis while here. Feedback OK jmc
2020-07-03Rename IN6_IFF_PRIVACY to IN6_IFF_TEMPORARY.Florian Obser
This is the name the other BSDs use for this, there is no reason to be different, the IPv6 RFCs call these addresses temporary, and some software in ports wants to use this as well. Most recently pointed out for firefox by landry. OK claudio, sthen
2020-06-27remove the spacing around "arp | rarp", as prompted by schwarze;Jason McIntyre
2020-06-27macro fixes; from matthew martinJason McIntyre
2020-06-24spelling fix; from matthias schmidtJason McIntyre
2020-06-22use (undocumented) base64 code in libc instead of libcrypto.David Gwynne
naddy gave me a pointer in the right direction ok millert@ deraadt@ looks good to matt dunwoodie
2020-06-21various minor tweaks;Jason McIntyre
2020-06-21wgpip -> wgendpoint. ok dlg@Matthieu Herrb
2020-06-21teach ifconfig about wireguard.David Gwynne
note that this links ifconfig with libcrypto to get at base64 encoding and decoding routines. im looking at an alternative way to do that, so hopefully this is temporary. secondly, note that all the wireguard stuff is under ifndef SMALL, so the special build of ifconfig for install media does include wireguard support, and also does not need libcrypto. from Matt Dunwoodie and Jason A. Donenfeld ok deraadt@
2020-04-29Add the 'nomimo' nwflag which disables MIMO in 11n mode.Stefan Sperling
This flag restricts a wireless driver to MCS0 - MCS7 for both transmission and reception. It can be set to work around packet loss in 11n mode caused by unused antenna connectors on a MIMO-capable wireless network device. man page tweak from tracey@ ok deraadt@
2020-04-23 ce examples of "Ar arg Ar arg" with "Ar arg arg" and stop the spread;Jason McIntyre
2020-02-27Do not set A_JOIN unconditionally. Otherwise join "" takes effect evenStefan Sperling
though that is not what the user intended, e.g. if an invalid hex SSID was given on the command line. ok sthen@
2020-02-24fix column alignment of 'ifconfig joinlist'; padding had an extra " "Stefan Sperling
2020-02-24Don't needlessly cap SSID width in 'ifconfig joinlist' (matters with hex SSIDs).Stefan Sperling
ok kevlo@
2020-02-24Clarify that nwid/join SSIDs must be printable ASCII if they're not hex.Stefan Sperling
ok kevlo@
2020-02-18Add IPv6 support to umb(4).Gerhard Roth
ok job@ bluhm@ claudio@ job@ tested with 'telnet -6 towel.blinkenlights.nl' on Fibocom L831-EAU on IIJ MIO's network (Japan), with 'inet6 autoconf' in /etc/hostname.umb0.
2020-01-22remove semicolons not needed after } statements. ok deraadtTed Unangst
2019-12-27Fix ifconfig WPA key installation with max allowed length SSIDs.Stefan Sperling
ok claudio phessler deraadt sthen
2019-11-30ifconfig(8) did silently ignore the netmask parameter for inet6 andAlexander Bluhm
interpreted only prefixlen. Also accept netmask for IPv6. This is consistent to our man page and the route(8) command. OK benno@
2019-11-27use _PATH_ names for unveil if possibleTheo de Raadt
2019-11-10Update wifi-related documentation in ifconfig man page.Stefan Sperling
ok jmc deraadt
2019-10-24Fix ifconfig(8) compiler warnings regarding variable "name" reuse.Alexander Bluhm
Call the global variable with the name of the interface "ifname". Do not pass it around, just use it globally. Do not use "ifname" for anything else. OK deraadt@
2019-10-17Fix some compiler warings in ifconfig(8). Move all prototypes andAlexander Bluhm
variables used in multiple .c files into common ifconfig.h. Basically this renames brconfig.h to ifconfig.h and also uses it for sff.c. Fix missing prototypes. Global variable name s is bad as it shadows local variables. Call it sock and use it everywhere. OK deraadt@
2019-09-20Document the output of 'ifconfig scan' in client mode.Stefan Sperling
ok mlarkin
2019-09-02Make net80211 expose reasons for association failures to userland and haveStefan Sperling
ifconfig display them in 'scan' output and on the ieee80211 status line if the failure is applicable to an already selected AP (e.g. wrong WPA key). This will hopefully reduce the amount of help requests for what often turn out to be trivial misconfiguration issues that were previously hard to diagnose without debug mode. ifconfig must be recompiled with the new ieee80211_ioctl.h to stay in sync with the kernel. A full 'make build' will do the right thing! Very helpful input by mpi@ and deraadt@
2019-08-30whitespace, found while pondering improvements to sffdumpTheo de Raadt
2019-08-29fix a comparison which generated a warning on sparc64.David Gwynne
found by deraadt@
2019-08-29make the list of OM fibre distances go OM1, OM2, OM3, not OM2, OM1, OM3David Gwynne
2019-08-28s/No separable connector/No connector/David Gwynne
shrinks some QSFP+ DAC output a bit.
2019-08-28remove some cruftDavid Gwynne
2019-08-28try to factor media information out and use it for qsfp as well as sfp.David Gwynne
qsfp and xfp have remarkably similar layouts, so we can use the same code to print media for both. sfp and xfp/qsfp generally have the same fields, just in different register locations and with some different scales/factors for some values. this change provides a map of these differences as structs for the sfp and qsfp/xfp layouts. the big difference between sfp, xfp, and qsfp that still remains is how they interpret the wavelength field. qsfp stores either optic wavelength in units of 0.05nm, or a couple of copper cable attenuation values in dB at different frequencies. sfp stores wavelength in nm units, but has magic values to blacklist copper cables with. xfp stores wavelength in 0.05 nm units, so more like like qsfp. right now the code uses the sfp behaviour, which means qsfp will show a weird wavelength for copper cables when it shouldnt. i'm still trying to figure out the least worst way to handle that, but at least it looks right for optics now.
2019-08-27print more qsfp temperature informationDavid Gwynne
this shows the maximum case temperature reported by the chip, and the low and high alarm ranges for temp and vcc when page 3 is available and working. this will hopefully give deraadt@ a better idea about how much headroom one of his 100g optics has.
2019-08-27have a go at printing more monitoring information.David Gwynne
this is a bit rough, but a good start. apart from the media types and length, qsfp support should be on par with sfp modules now.
2019-08-27make a start at reporting qsfp monitor values.David Gwynne
i have some qsfp DACs and a couple of optics, and they're all terrible, so this is about as far as i can go for now. at least the code will be robust in the face of terrible modules though. the DACs are pretty dumb and basically report that they're DACs with some strings. this code just prints that they're DACs with strings now. modules are supposed to be able to report overall temperature and voltage, and optics can report tx and rx values for the 4 different signal lanes they're supposed to provide. interestingly the current values are always reported in the lower page, but thresholds are reported in page 3, but not all modules support page switching. devices are supposed to say whether they can switch pages, but i have one that does say it can switch but then doesn't. anyway, the take away is that it is therefore possible for a module to report values without also reporting thresholds. this sets the code up to report the values on their own if we can't query page 3 for any reason. if the temp sensor value looks bogus (ie, 0x0000 or 0xffff), assume the monitor values are bogus and bail early. hopefully i can find a module soon that supports multiple signal lanes and actually reports their values and thresholds for them.
2019-08-26Adjust umb DNS printing code since the type of those addresses changed.Claudio Jeker
OK gerhard@
2019-08-21 Remove support for semantically opace interface identifiers (RFC 7217)Florian Obser
for IPv6 link local addresses. Some hosting and VM providers route customer IPv6 prefixes to link local addresses derived from ethernet MAC addresses (RFC 2464). This leads to hard to debug IPv6 connectivity problems and is probably not worth the effort. RFC 7721 lists 4 weaknesses: 3.1. Correlation of Activities over Time & 3.2. Location Tracking These are still possible with RFC 7217 addresses for an adversary connected to the same layer 2 network (think conference wifi). Since the link local prefix stays the same (fe80::/64) the link local addresses do not change between different networks. An adversary on the same layer 2 network can probably track ethernet MAC addresses via different means, too. 3.3. Address Scanning & 3.4. Device-Specific Vulnerability Exploitation These now become possible, however, as noted above a layer 2 adversary was probably able to do this via different means. People concerned with these weaknesses are advised to use ifconfig lladdr random. OK benno input & OK kn