summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig/ifconfig.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert the change of flowid output format. [1]vsevolod2015-02-021-1/+1
| | | | | | | | Reverse the sorting order of the interfaces addresses familise so it should be the same as getifaddrs(3) order. [2] Suggested by: hrs [1], bz [2] Approved by: hrs, bapt
* Style(9) fixes.vsevolod2015-02-021-15/+19
| | | | | Approved by: bapt, ae X-MFC-With: r278080
* Reorganize the list of addresses associated with an interface and group themvsevolod2015-02-021-2/+168
| | | | | | | | | | | | | | | | based on the address family. This should help to recognize interfaces with multiple AF (e.g. ipv4 and ipv6) with many aliases or additional addresses. The order of addresses inside a single group is strictly preserved. Improve the scope_id output for AF_INET6 families, as the current approach uses hexadecimal string that is basically the ID of an interface, whilst this information is already depicted by getnameinfo(3) call. Therefore, now ifconfig just prints the scope of address as it is defined in 2.4 of RFC 2373. PR: 197270 Approved by: bapt MFC after: 2 weeks
* Revert r272390.hrs2014-10-021-1/+1
| | | | Pointed out by: glebius
* Add IFCAP_HWSTATS.hrs2014-10-021-1/+1
|
* Add support for reading i2c SFP/SFP+ data from NIC driver andmelifaro2014-08-161-0/+3
| | | | | | | | presenting most interesting fields via ifconfig -v. This version supports Intel ixgbe driver only. Tested on: Cisco,Intel,Mellanox,ModuleTech,Molex transceivers MFC after: 2 weeks
* Fix a typo in a comment: s/interprete/interpret/gjb2014-08-121-1/+1
| | | | | | Submitted by: Sam Fourman Jr. MFC after: 3 days Sponsored by: The FreeBSD Foundation
* Remove IPX support.glebius2014-03-141-15/+0
| | | | | | | | | | | IPX was a network transport protocol in Novell's NetWare network operating system from late 80s and then 90s. The NetWare itself switched to TCP/IP as default transport in 1998. Later, in this century the Novell Open Enterprise Server became successor of Novell NetWare. The last release that claimed to still support IPX was OES 2 in 2007. Routing equipment vendors (e.g. Cisco) discontinued support for IPX in 2011. Thus, IPX won't be supported in FreeBSD 11.0-RELEASE.
* Axe IFF_SMART.glebius2013-11-051-1/+1
| | | | Submitted by: pluknet
* Fix socket calls on error post-r243965.kevlo2012-12-211-1/+1
| | | | Submitted by: Garrett Cooper
* - Updated TOE support in the kernel.np2012-06-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Stateful TCP offload drivers for Terminator 3 and 4 (T3 and T4) ASICs. These are available as t3_tom and t4_tom modules that augment cxgb(4) and cxgbe(4) respectively. The cxgb/cxgbe drivers continue to work as usual with or without these extra features. - iWARP driver for Terminator 3 ASIC (kernel verbs). T4 iWARP in the works and will follow soon. Build-tested with make universe. 30s overview ============ What interfaces support TCP offload? Look for TOE4 and/or TOE6 in the capabilities of an interface: # ifconfig -m | grep TOE Enable/disable TCP offload on an interface (just like any other ifnet capability): # ifconfig cxgbe0 toe # ifconfig cxgbe0 -toe Which connections are offloaded? Look for toe4 and/or toe6 in the output of netstat and sockstat: # netstat -np tcp | grep toe # sockstat -46c | grep toe Reviewed by: bz, gnn Sponsored by: Chelsio communications. MFC after: ~3 months (after 9.1, and after ensuring MFC is feasible)
* Removed the IFCAP_ prefix when printing the IPv6 checksum capabilities.bz2012-05-281-1/+1
| | | | | Submitted by: dim MFC after: 3 days
* It turns out that too many drivers are not only parsing the L2/3/4bz2012-05-281-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | headers for TSO but also for generic checksum offloading. Ideally we would only have one common function shared amongst all drivers, and perhaps when updating them for IPv6 we should introduce that. Eventually we should provide the meta information along with mbufs to avoid (re-)parsing entirely. To not break IPv6 (checksums and offload) and to be able to MFC the changes without risking to hurt 3rd party drivers, duplicate the v4 framework, as other OSes have done as well. Introduce interface capability flags for TX/RX checksum offload with IPv6, to allow independent toggling (where possible). Add CSUM_*_IPV6 flags for UDP/TCP over IPv6, and reserve further for SCTP, and IPv6 fragmentation. Define CSUM_DELAY_DATA_IPV6 as we do for legacy IP and add an alias for CSUM_DATA_VALID_IPV6. This pretty much brings IPv6 handling in line with IPv4. TSO is still handled in a different way and not via if_hwassist. Update ifconfig to allow (un)setting of the new capability flags. Update loopback to announce the new capabilities and if_hwassist flags. Individual driver updates will have to follow, as will SCTP. Reported by: gallatin, dim, .. Reviewed by: gallatin (glanced at?) MFC after: 3 days X-MFC with: r235961,235959,235958
* MFp4 bz_ipv6_fast:bz2012-05-191-0/+4
| | | | | | | | | | | | Allow tso4 and tso6 be set individually given we have the bits. This will help with drivers not working as expected during the transition time and later. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn MFC After: 1 week
* Disable jail support in ifconfig when either building a rescuermh2012-02-141-0/+8
| | | | | | | image or MK_JAIL knob has been set to "no". Reviewed by: bz Approved by: adrian (mentor)
* A major overhaul of the CARP implementation. The ip_carp.c was startedglebius2011-12-161-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from scratch, copying needed functionality from the old implemenation on demand, with a thorough review of all code. The main change is that interface layer has been removed from the CARP. Now redundant addresses are configured exactly on the interfaces, they run on. The CARP configuration itself is, as before, configured and read via SIOCSVH/SIOCGVH ioctls. A new prefix created with SIOCAIFADDR or SIOCAIFADDR_IN6 may now be configured to a particular virtual host id, which makes the prefix redundant. ifconfig(8) semantics has been changed too: now one doesn't need to clone carpXX interface, he/she should directly configure a vhid on a Ethernet interface. To supply vhid data from the kernel to an application the getifaddrs(8) function had been changed to pass ifam_data with each address. [1] The new implementation definitely closes all PRs related to carp(4) being an interface, and may close several others. It also allows to run a single redundant IP per interface. Big thanks to Bjoern Zeeb for his help with inet6 part of patch, for idea on using ifam_data and for several rounds of reviewing! PR: kern/117000, kern/126945, kern/126714, kern/120130, kern/117448 Reviewed by: bz Submitted by: bz [1]
* If compiling RESCUE always ignore feature_present(3) calls so thatbz2011-07-181-0/+2
| | | | | | | | | | a /rescue/ifconfig more modern than the kernel could still configure IPv4 or IPv6 addresses. Reported by: Andrzej Tobola (ato iem.pw.edu.pl) Reported by: gcooper MFC after: 1 day X-MFC: will not MFC any time soon, just reminder for r222527
* Grab one of the ifcap bits for netmap, and enable printing in ifconfig.luigi2011-06-141-1/+1
| | | | | | | Document the fact that we might want an IFCAP_CANTCHANGE mask, even though the value is not yet used in sys/net/if.c (asked on -current a week ago, no feedback so i assume no objection).
* Conditionally compile in the af_inet and af_inet6, af_nd6 modules.bz2011-05-311-2/+25
| | | | | | | | | | | | | | | | | | | | | If compiled in for dual-stack use, test with feature_present(3) to see if we should register the IPv4/IPv6 address family related options. In case there is no "inet" support we would love to go with the usage() and make the address family mandatory (as it is for anything but inet in theory). Unfortunately people are used to ifconfig IF up/down etc. as well, so use a fallback of "link". Adjust the man page to reflect these minor details. Improve error handling printing a warning in addition to the usage telling that we do not know the given address family in two places. Reviewed by: hrs, rwatson Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after: 2 weeks
* Introduces IFF_CANTCONFIG interface flag to point that the interfaceweongyo2010-12-071-2/+2
| | | | | | | | | isn't configurable in a meaningful way. This is for ifconfig(8) or other tools not to change code whenever IFT_USB-like interfaces are registered at the interface list. Reviewed by: brooks No objections: gavin, jkim
* Don't print usbus[0-9] interfaces that it's not the interestingweongyo2010-12-011-0/+2
| | | | interface type for ifconfig(8).
* Ethernet vlan(4) interfaces have valid Ethernet link layer addresses butjhb2010-08-061-1/+3
| | | | | | | | use a different interface type (IFT_L2VLAN vs IFT_ETHER). Treat IFT_L2VLAN interfaces like IFT_ETHER interfaces when handling link layer addresses. Reviewed by: syrinx (bsnmpd) MFC after: 1 week
* When an underlying ioctl(2) handler returns an error, our ioctl(2)delphij2010-04-141-11/+12
| | | | | | | | | | | | | | | | | interface considers that it hits a fatal error, and will not copyout the request structure back for _IOW and _IOWR ioctls, keeping them untouched. The previous implementation of the SIOCGIFDESCR ioctl intends to feed the buffer length back to userland. However, if we return an error, the feedback would be defeated and ifconfig(8) would trap into an infinite loop. This commit changes SIOCGIFDESCR to set buffer field to NULL to indicate the previous ENAMETOOLONG case. Reported by: bschmidt MFC after: 2 weeks
* Verify interface up status using its link state onlyqingli2010-03-161-1/+1
| | | | | | | | | | | | | | if the interface has such capability. The interface capability flag indicates whether such capability exists. This approach is much more backward compatible. Physical device driver changes will be part of another commit. Also updated the ifconfig utility to show the LINKSTATE capability if present. Reviewed by: rwatson, imp, juli MFC after: 3 days
* Add TSO support on VLAN in fconfig(8).yongari2010-02-201-1/+1
| | | | Reviewed by: thompsa
* Revised revision 199201 (add interface description capability as inspireddelphij2010-01-271-1/+59
| | | | | | | | by OpenBSD), based on comments from many, including rwatson, jhb, brooks and others. Sponsored by: iXsystems, Inc. MFC after: 1 month
* Make ``ifconfig -l ether'' only list interfaces that speak Ethernet.will2009-11-251-3/+19
| | | | | PR: 118987 Approved by: ken (mentor)
* Revert revision 199201 for now as it has introduced a kernel vulnerabilitydelphij2009-11-121-53/+0
| | | | and requires more polishing.
* Add interface description capability as inspired by OpenBSD.delphij2009-11-111-0/+53
| | | | MFC after: 3 months
* Make ifconfig ifN -vnet <jname|jid> actually work:bz2009-07-261-7/+20
| | | | | | | | | | - fix ifconfig to ignore the non-existent interface in the current network stack in case of '-vnet'. - in ifconfig: actually use the local variables defined for the vnet functions rather than modifying the global. Reviewed by: rwatson Approved by: re (kib)
* Add the "vnet" and "-vnet" options, to allow moving interfaces betweenjamie2009-06-241-0/+31
| | | | | | jails with VIMAGE. Approved by: bz (mentor)
* - Use size_t instead of int when appropriate;delphij2009-06-231-1/+1
| | | | | | - Use C99 sparse initialization. With these changes ifconfig(8) is WARNS=2 clean.
* ifconfig(8) no longer needs to know how to print the IFF_NEEDSGIANT flag,rwatson2009-04-181-1/+1
| | | | since it shortly won't be defined at all.
* Default to AF_LOCAL instead of AF_INET sockets for non-family-specificjamie2009-03-151-10/+12
| | | | | | | operations. This allows the query operations to work in non-IPv4 jails, and will be necessary in a future of possible non-INET networking. Approved by: bz (mentor)
* use correct interface name when setting flags; fixes ifconfig ... create ... upsam2009-01-141-2/+2
| | | | Noticed by: Chris Anderson
* Distinguish between cmd/parameters used for clone operations andsam2008-09-291-33/+43
| | | | | | | | | | | all others. Use this to disambiguate cmd line arguments that can be either clone params or regular parameters so, in particular, "bssid" again works as a regular parameter. While here leverage the above to improve the logic for flushing clone operations on the first !clone cmd line parameter. Reviewed by: jhay
* Add support in ifconfig to control the vlan hardware filter feature.jfv2008-08-281-1/+2
| | | | | Reviewed by: EvilSam and moi MFC after:1 week
* Move the grekey to its own file, ifconfig.c does not have interface specificthompsa2008-08-031-20/+0
| | | | | | code. Submitted by: sam
* Add support for the optional key in the GRE header.thompsa2008-06-201-0/+20
| | | | | PR: kern/114714 Submitted by: Cristian KLEIN
* Fix handling of create operation together with setting other parameters:sam2008-03-311-5/+35
| | | | | | | | | | | o mark cmds/parameters to indicate they are potential arguments to a clone operation (e.g. vlantag) o when handling a create/clone operation do the callback on seeing the first non-clone cmd line argument so the new device is created and can be used; and re-setup operating state to reflect the newly created device Reviewed by: Eugene Grosbein MFC after: 2 weeks
* Wake On Lan (WOL) infrastructuresam2007-12-101-1/+9
| | | | | Submitted by: Stefan Sperling <stsp@stsp.name> Reviewed by: brooks
* Fix the module name matching to the drivers present in the kernel. Previouslythompsa2007-10-041-7/+14
| | | | | | | | | | | | it would return true on a partial match where it would think the edsc module was already present by having a positive match on 'ed'. This changes it so that it compares the full string including the nul terminators. This also fixes a buffer overflow in the ifkind variable where the length of the interface name in *argv wasnt checked for size. Reviewed by: brooks Approved by: re (gnn)
* Remove IPX over IP tunneling pieces from ifconfig(8), omitted portion ofrwatson2007-06-131-2/+0
| | | | | | | | | | | | | | | previous commit: Remove IPX over IP tunneling support, which allows IPX routing over IP tunnels, and was not MPSAFE. The code can be easily restored in the event that someone with an IPX over IP tunnel configuration can work with me to test patches. This removes one of five remaining consumers of NET_NEEDS_GIANT. Approved by: re (kensmith) Spotted by: Artem Naluzhny <tutat nhamon dot com dot ua>
* Add reporting and toggling of TCP LRO (large receive offload) support toandre2007-06-111-1/+3
| | | | ifconfig(8).
* Add the -n flag for disabling automatic module loading, this will be used bythompsa2007-05-221-2/+10
| | | | rc.d to stop it reloading the network module on unload.
* Back out rev. 1.129 because it breaks the practice of auto-loadingyar2007-03-241-1/+3
| | | | | | | | hardware drivers. Unlike pseudo-device drivers, which just attach to the cloning framework and wait for "ifconfig create", h/w drivers create interfaces for installed cards as soon as loaded. The issue of devd(8) involuntarily reloading modules should be dealt with in a different way.
* Attempt to load the kernel module only if we are going to create ayar2007-03-121-3/+1
| | | | | | | | | new interface. In other cases loading the module is unwanted and can lead to ill side effects. One such effect found is as follows: "kldunload if_foo" tells the module to kill all its interfaces, which results in messages sent to devd; the module unloads. Then devd starts processing the messages, which ends up in a etc script running ifconfig fooX, which reloads the module.
* o consistently check strlcpy resultsam2007-02-271-2/+10
| | | | o warn when we skip an interface because it's name is too long
* correct type to silence const complaintsam2007-02-271-1/+2
|
* unbreak create operation, must copy argument to global namesam2007-02-271-0/+1
| | | | Spotted by: des
OpenPOWER on IntegriCloud