Commit Graph

67 Commits

Author SHA1 Message Date
Sam Leffler
e653f1f0f4 add reject+blackhole keywords to install entries with RTF_BLACKHOLE
and RTF_REJECT, respectively

PR:		bin/79228
Submitted by:	Dan Lukes <dan@obluda.cz>
MFC after:	2 weeks
2008-03-18 21:45:27 +00:00
Sam Leffler
0c80179c55 quiet compiler complaint about comparing &v against NULL 2008-01-10 04:26:44 +00:00
Kevin Lo
d069140339 Use sizeof() for calculating the buffer size instead of hard-coded values. 2007-03-06 09:32:41 +00:00
Gleb Smirnoff
06274cee44 - Before doing ioctl(SIOCGIFNETMASK) put the proper IP address into the ifreq,
to obtain correct netmask in case of interface with multiple aliases.
- While here, remove a comment with a bad idea.

PR:		bin/42120
Submitted by:	Dmitry Frolov <frolov riss-telecom.ru>
2006-10-13 12:38:43 +00:00
Ruslan Ermilov
f6385e481e Sync utility's usage() with manpage's SYNOPSIS. 2006-09-29 16:07:44 +00:00
Gleb Smirnoff
a47c388cce Refuse to install invalid ARP entries.
Submitted by:	Vitaliy Ovsyannikov <V.Ovsyannikov kr.ru>
2006-02-09 12:49:39 +00:00
Brooks Davis
582fa422ec Update usage to reflect the fact that the -d -a now accepts -i <interface>.
Reminded by:	ru
Pointy hat:	brooks
2006-01-10 16:15:58 +00:00
Brooks Davis
0836985219 Allow the -i <interface> option with -d -a to allow all arp entries for
a given interface to be removed.
2006-01-10 05:17:16 +00:00
Andrew Thompson
9af9b983e1 List IFT_BRIDGE as a valid type so that arp entries can be properly deleted.
Submitted by:	Michal Mertl <mime^traveller.cz>
2005-11-03 00:56:43 +00:00
Ruslan Ermilov
f3f8b226ef Commit some cosmetic fixes I developed some time ago, mostly style but
one functional change (fixed exit status from the "get" operation).
2005-06-09 15:27:46 +00:00
Gleb Smirnoff
cf77958920 Fix exit status. In rev. 1.48 return logic of rtmsg() was confused. This
made arp(8) command exit status reversed for -s and -S.

Reported by:	sem
MFC after:	2 weeks
2005-06-09 15:00:31 +00:00
Maxim Konovalov
19beed5e2e o Reorganize the previous delta to make it more style(9) compliant.
Submitted by:	ru

o Reduce an amount of memory we ask in advance.
2005-01-24 17:01:48 +00:00
Maxim Konovalov
66658902ed o Try hard to guess a buffer size for a fast growing routing table.
An approach taken from killall/killall.c.

PR:		bin/76075
Submitted by:	Dmitrij Tejblum
MFC after:	3 weeks
2005-01-24 13:27:24 +00:00
Ruslan Ermilov
596e374dac For VLAN interfaces, print MAC addresses properly.
(Broken in rev. 1.52.)

PR:		75471
Submitted by:	Jon Simola
MFC after:	3 days
2004-12-24 22:16:38 +00:00
Warner Losh
23717fc46a Per letter dated July 22, 1999, delete clause 3 from code directly
from Berkeley.
2004-08-07 04:19:37 +00:00
Doug Rabson
21816de34f Be smarter about printing non-ethernet link-level addresses. 2004-06-13 10:57:10 +00:00
Stefan Farfeleder
1a5ff9285a Avoid assignments to cast expressions.
Reviewed by:	md5
Approved by:	das (mentor)
2004-06-08 13:08:19 +00:00
Luigi Rizzo
68839124b6 Massive cleanup of the code removing global variables to
pass function arguments and results.

Hopefully no functional changes except fixing a couple of
bugs which could cause endless loops if an ioctl() on an
interface would fail.
2004-04-13 14:16:37 +00:00
Luigi Rizzo
0b46c08590 Replace ROUNDUP/ADVANCE with SA_SIZE 2004-04-13 11:24:43 +00:00
Luigi Rizzo
bdf932ae27 Make functions and variables static.
Remove global variables in favour of local ones.
Fix indentation of a couple of switch statements.

Overall, this program badly need cleaning up, as it relies
on information passed around through global variables.
2004-04-13 08:34:52 +00:00
Maxime Henrion
e2416749bf - Change several errx() calls that should have been err() calls.
- Handle empty ARP tables properly.
- Remove register keyword.
- arp(8) is WARNS?=4 clean, so mark it as such to avoid regressions.
2004-04-09 14:27:28 +00:00
Yaroslav Tykhiy
b9de94e9eb Implement a new option: -i, which will allow to limit
the scope of operation to the ARP entries on a particular
interface.  It should be useful on machines with numerous
network interfaces, e.g., on inter-VLAN routers.

PR:		bin/54151
Submitted by:	Dmitry Morozovsky <marck at rinet.ru>
Discussed on:	-net
MFC after:	2 weeks
2003-07-18 13:48:06 +00:00
David E. O'Brien
b728350ee6 Use __FBSDID over rcsid[]. Protect copyright[] where needed. 2003-05-03 21:06:42 +00:00
Ruslan Ermilov
4bfc36240e Further fix the syntax by ignoring empty and whitespace-only lines.
Prompted by:	Eugene Grosbein <eugen@kuzbass.ru>
2003-03-05 15:53:18 +00:00
Ruslan Ermilov
3adcd04299 Don't hide global `s'. 2003-01-17 08:10:43 +00:00
Ruslan Ermilov
44acbc1adc POLA dictates that in the file designated with the -f option
argument, leading whitespace and empty lines be ignored, and
the `#' character marks the rest of the line as a comment.

PR:		bin/45958
MFC after:	3 days
2002-12-27 10:09:04 +00:00
Juli Mallett
42f3352b5c Change 'int pid' to 'pid_t pid'
Submitted by:	Bruce "Allah" Dang <bruce@research.teamxor.org>
2002-07-25 01:48:19 +00:00
Bill Paul
2ab778e1d3 Unbreak this file after the last drive-by committing. We have to
#include route.h before iso88025.h, and we have to dereference
the trld_route array correctly. (NOTE: I'm not altogether sure
that this is really the correct way to traverse this array. This
just eliminates the build warning/error. It may not work right at
runtime, and I have no way to test it since I lack the necessary
hardware.)

Broken by: kbyanc, who gets to wear the pointy hat
2002-05-09 00:37:57 +00:00
Kelly Yancey
97fe20b4d0 Update ARP to access token-ring source routing information at it's new
location.

Not tested by:	me (sorry!)
Sponsored by:	NTT Multimedia Communications Labs
2002-05-08 00:55:29 +00:00
Murray Stokely
123b2d4a74 GCC 3.1 cleanup - add a break after default: at the end of a switch
statement.
2002-04-07 12:05:05 +00:00
Ruslan Ermilov
a03b1b7ced Don't reinvent the wheel now that ether_ntoa(3) has been fixed
to print leading zeros in libc_net/ether_addr.c,v 1.13.

MFC after:	3 days
2002-04-06 09:01:44 +00:00
Mike Barcroft
467a0b0647 Include <string.h> for some prototypes, rather than depending on
pollution from <strings.h>.
2002-04-01 21:13:17 +00:00
Mike Heffner
9cc7cb5818 Fix bugs from previous commit: initialize the correct field and use
the correct local variable.

Caught by: Joachim Isaksson <Joachim.Isaksson@algitech.com>
Pointy hat to: mikeh
2002-03-20 01:31:15 +00:00
Mike Heffner
9d34414bc2 WARNS=2 cleanup.
Submitted by:	Maxime Henrion <mux@qualys.com>
MFC after:	2 weeks
2001-12-10 06:42:56 +00:00
Matthew N. Dodd
0442747236 Print [fddi] or [atm] tags for ARP addresses on interfaces of that type. 2001-10-19 00:33:26 +00:00
Ruslan Ermilov
e87a372b7f Print interface name for each ARP entry.
Prodded by:	Igor Podlesny <poige@morning.ru>
MFC after:	1 week
2001-10-08 11:52:23 +00:00
Ruslan Ermilov
3f844a2221 - Renamed the `proxy'' modifier of the -d flag to `pub'',
to be consistent with the -s flag.  Updated documentation
  on what this modifier does.

- Added the ``only'' keyword to the -s and -S flags, that
  could be used to created "proxy-only" published entries.
  Previously, arp(8) created an entry of this type only
  in the absence of the route to a destination.

PR:		bin/12357
MFC after:	1 week
2001-06-07 12:35:53 +00:00
Yaroslav Tykhiy
ae14be2007 Add a missing free(3).
PR:		bin/27001
Submitted by:	alex <ml-freebsd-net@phobgate.de>,
		Matthew Emmerton <matt@gsicomp.on.ca>
2001-05-02 19:07:46 +00:00
Yaroslav Tykhiy
88d5b61358 Add the VLAN interface type to the list of ARP-capable interface types. 2001-04-04 15:14:06 +00:00
Bill Fumerola
5651a03692 zeropad mac address ouput
PR:		bin/25584
Submitted by:	David Xu <davidx@viasoft.com.cn>
Reviewed by:	wollman, billf
2001-03-08 01:52:49 +00:00
Warner Losh
59aadf9385 h_errno is declared in netdb.h. 2001-03-01 06:41:43 +00:00
Ruslan Ermilov
eec827b042 Print a diagnostic message if no interface could be determined
when attempting to create a published ARP entry.  For example:

# arp -s 1.1.1.1 auto pub

PR:		bin/7753
Submitted by:	Jonathan Hanna <pangolin@home.com>
2001-02-27 09:02:10 +00:00
Ruslan Ermilov
9ea1ba64dd Make the ``arp -d hostname proxy'' really do something useful.
Specifically, ``proxy'' modifier tells the code to delete only
Proxy ARP entry for the ``hostname''; the usual ARP entry will
be unaffected by this operation.
2001-02-05 16:57:56 +00:00
Archie Cobbs
e03bb411ee Revert previous checkin ("proxy" is required in some instances).
Add a note to that effect to the man page.
2001-02-01 21:23:16 +00:00
Archie Cobbs
bceb4f5a60 Fix documentation: "proxy" is not a keyword for the arp(8) command line. 2001-01-31 00:03:31 +00:00
Yoshinobu Inoue
1fece1a6b6 Change type of vars which hold in_addr.s_addr from u_long to u_int32_t,
for more safety on alpha.

Approved by: jkh
2000-03-03 13:01:57 +00:00
Jordan K. Hubbard
135adb1eda Fix syntax error in previous commit. 2000-01-17 01:44:16 +00:00
Kris Kennaway
0cecd500a4 Don't overflow buffers.
Reviewed by:	audit@freebsd.org
2000-01-16 21:15:50 +00:00
Ruslan Ermilov
08e13cdfa7 Yet another align.
It will be required if sizeof(struct sockaddr_in) changes in the future.

Not objected to by:	wollman
1999-09-20 09:10:46 +00:00
Ruslan Ermilov
3a6a5ebeb6 Align sockaddrs passed to/from the routing socket as supposed by kernel.
PR:		12847
Spotted by:	Key Teck Sin <ktsin@acm.org>
Reviewed by:	wollman
1999-09-13 23:32:53 +00:00