Commit Graph

407 Commits

Author SHA1 Message Date
matt 5a355fa389 Rename link to link_pkw to avoid shadowing the link syscall. 2014-01-19 22:31:13 +00:00
christos 6a0886ad81 perror is obsolete, use warn and add missing paren. 2014-01-08 01:56:20 +00:00
degroote f2475e079d Before scanning, check if the card is up. If it is not the case, exit
with some useful error message. Add some note about this fact in the man
page too.
2014-01-07 20:25:24 +00:00
kefren 88644df51c Bring tunnel src_addr and dst_addr on the same line 2013-11-09 13:10:35 +00:00
christos 740c6aa538 use correct function 2013-10-19 15:59:15 +00:00
christos 730b60ec52 use symbolic flags 2013-10-19 15:50:26 +00:00
christos 0dd81edd01 use the new scopeid functions 2013-10-19 00:35:30 +00:00
christos d8748c5de0 print the next parser name instead of just the pointer in debugging. 2013-07-17 15:42:03 +00:00
christos ee1471609b Allow -v to be used with other commands (list scan for example) as documented. 2013-07-17 15:40:42 +00:00
joerg e240adbd0b Retire OSI network stack. OK core@ 2013-03-01 18:25:13 +00:00
apb 819da78f2e Abort on error from prop_dictionary_augment. 2013-02-07 13:21:34 +00:00
apb acc2342d2c Avoid dereferencing NULL. Coverity CID 275201.
Also fix a typo in previous: !== should be !=
2013-02-07 13:20:51 +00:00
apb beb9ef8fe5 Don't call prop_distionary_make_immutable on a NULL pointer.
Coverity CID 275179.
2013-02-07 11:24:15 +00:00
christos 17cb1d718c fix function name in error messages. 2012-12-30 22:52:35 +00:00
christos 082a5b2911 PR/46579: Takahiro HAYASHI: ifconfig clone destroy should not print useless
diagnostic and exit with an error code. Get the interface name and flags
opportunistically to allow the code to return normally if it does not need
to do anything.
2012-12-30 22:50:42 +00:00
pgoyette 52dd3d0558 Use snprintb_m(3) to split flags/capabilities/enabled across multiple
output lines.

As discussed on current-users
2012-11-01 13:43:23 +00:00
msaitoh bbc956a9be Add SIOCGETHERCAP ioctl.
There was no way to know the setting of ec_capabilities and ec_capenable
other than grepping the source.

See http://mail-index.netbsd.org/tech-kern/2010/07/28/msg008613.html
2012-10-31 10:17:34 +00:00
christos 54abeff8fd don't define RUMP_ACTION if MKRUMP = no 2012-08-08 14:10:38 +00:00
christos c583007244 PR/43141: Tobias Nygren: Print an error on unknown interfaces. 2012-03-17 02:25:08 +00:00
mbalmer 28c55e99d7 When ifconfig is invoked without any arguments, display the list of
all network interfaces (equivalent to ifconfig -a), instead of displaying
the usage.  (This is consistent with the behaviour on FreeBSD and OpenBSD.)
2012-01-28 15:01:44 +00:00
joerg baa8e84b6f Use __dead 2011-08-29 14:34:58 +00:00
christos f5bc231029 use memcpy to avoid strict aliasing warnings 2011-08-14 12:15:15 +00:00
mrg c111245a78 apply some -Wno-error and/or -fno-strict-aliasing.
all of this should be looked at closer, but some of them are not
very trivial.
2011-06-22 02:49:41 +00:00
riastradh 63cdfaffb6 Fix typo: `symbolically' takes three l's, not two. 2011-05-31 16:17:30 +00:00
joerg b1162954df Don't use address strings as format string. 2011-05-24 11:38:56 +00:00
pooka 72e657672d A few weeks ago when i added "linkstr" support I didn't know that
the string parser gives a proplib object which isn't a terminated
string.  Fix that mistake now.
2010-12-14 10:51:51 +00:00
pooka 67a4f392d8 use crunchops for crunchables 2010-12-13 21:48:01 +00:00
njoly 6c19f9ea7b op_read return value is a ssize_t, not an int. 2010-12-13 19:17:20 +00:00
pooka a415ef09e9 Convert from the .ifdef RUMP_ACTION stuff to RUMPPRG. 2010-12-13 17:35:08 +00:00
pooka 6f2301fb3c Implement ifconfig linkstr as proposed on tech-net. 2010-11-15 22:42:36 +00:00
pooka 2ddc760fc7 Need getifaddrs() for the rump client since it executes sysctl(2) 2010-11-05 16:23:56 +00:00
pooka 7d1c54af24 adapt to new rumpclient_init() signature 2010-11-05 13:52:41 +00:00
pooka 23c2b7b527 Update RUMP_ACTION to use the newstyle rump client. 2010-11-04 23:31:12 +00:00
dyoung aa9db6efb2 Add to the string parse object (pstr), and its constructors, a flag that
tells whether it should detect and convert to binary a hexadecimal octet
string of the form 0x0123ABab, or leave those strings undecoded.

If the argument for a 'media', 'mediamode', 'mediaopt', '-mediaopt',
'nwkey', or 'bssid' keyword is a hexadecimal octet string, do not detect
and decode it.  (Note that setifnwkey decodes hexadecimal strings on its
own.)

This fixes a bug noticed by Jim Miller where the trailing zero-octets
were discarded from hexadecimal octet-string arguments for 'nwkey'.
2010-07-01 16:44:05 +00:00
dyoung de51d12924 Apparently, -g belongs in the DBG variable, not in CFLAGS. Make it so
on a line that is commented-out in this makefile.
2010-07-01 16:28:21 +00:00
dyoung 83fdd687cf Change a > to a >= to avoid writing to the character after the end of
the buffer passed to get_string().
2010-07-01 16:12:23 +00:00
plunky a5a749a5f7 C99 says that offsetof() expands to a constant expresssion, so we
can't use variable array index in there. Do the calculation manually
for C99 compilers (pcc)
2010-04-20 21:25:25 +00:00
is c41a4b460e Use getnameinfo() for printing AppleTalk addresses. While here, fix
printing of broadcast for this address family (AT broadcast is fixed
node 255 on the local net).
2010-01-30 18:30:33 +00:00
dyoung 6abb73d262 Compare a pointer with NULL instead of testing its "truth." 2010-01-22 23:50:07 +00:00
tsutsui aa68f4ed1a - no space needed between -I and dir per gcc(1)
- it's still better to use ${NETBSDSRCDIR} per other existing Makefiles
2009-09-16 15:08:29 +00:00
tsutsui d60368466f Add comments that Makefile.inc should have shared stuff with
src/distrib/utils/x_ifconfig for install media.
2009-09-16 14:59:45 +00:00
he ad8225c04b Move the addition of pfsync.c from Makefile.inc to Makefile,
so that this part doesn't get included in install media versions
of ifconfig, as per comments on source-changes@ from Izumi Tsutsui.
Also re-instate the use of ${.CURDIR} when setting up the include path.
2009-09-15 09:22:07 +00:00
he 4cf3355067 Change from using ${.CURDIR} to ${NETBSDSRCDIR} because this file
may be included by different parts of the source tree, in particular
deep down in the distrib/ tree, where ../.. isn't sufficient to "climb"
up to the top of the tree.  Fixes the build at least for our arc port.
2009-09-14 15:12:21 +00:00
degroote 2d48ac808c Import pfsync support from OpenBSD 4.2
Pfsync interface exposes change in the pf(4) over a pseudo-interface, and can
be used to synchronise different pf.

This work was part of my 2009 GSoC

No objection on tech-net@
2009-09-14 10:36:48 +00:00
dyoung 230fd8c662 This should fix 'carpdev <ifname>' or, at least, not break it more
badly than before.
2009-09-11 23:22:28 +00:00
dyoung c5d5f7697a Make ifconfig(8) set and display preference numbers for IPv6
addresses.  Make the kernel support SIOC[SG]IFADDRPREF for IPv6
interface addresses.

In in6ifa_ifpforlinklocal(), consult preference numbers before
making an otherwise arbitrary choice of in6_ifaddr.  Otherwise,
preference numbers are *not* consulted by the kernel, but that will
be rather easy for somebody with a little bit of free time to fix.

Please note that setting the preference number for a link-local
IPv6 address does not work right, yet, but that ought to be fixed
soon.

In support of the changes above,

1 Add a method to struct domain for "externalizing" a sockaddr, and
  provide an implementation for IPv6.  Expect more work in this area: it
  may be more proper to say that the IPv6 implementation "internalizes"
  a sockaddr.  Add sockaddr_externalize().

2 Add a subroutine, sofamily(), that returns a struct socket's address
  family or AF_UNSPEC.

3 Make a lot of IPv4-specific code generic, and move it from
  sys/netinet/ to sys/net/ for re-use by IPv6 parts of the kernel and
  ifconfig(8).
2009-09-11 22:06:29 +00:00
dyoung fcabb0789a Describe the -N flag. 2009-08-07 20:13:12 +00:00
dyoung ae9b1bdb85 Use getnameinfo(3) instead of inet_ntoa(3) to convert IPv4 addresses
to names.
2009-08-07 19:35:55 +00:00
dyoung ab7c5957a9 Add option -N. -N is just the opposite of option -n in netstat(8)
or route(8): it tells ifconfig(8) to try to resolve numbers to
hosts and service names.

This default ifconfig behavior stays the same as it always was.
2009-08-07 18:53:37 +00:00
hubertf 270beabd82 Add "MAC" keyword to the corresponding example. 2009-07-29 21:47:11 +00:00