diff -Nru iputils-20101006/.git/COMMIT_EDITMSG iputils-20121221/.git/COMMIT_EDITMSG --- iputils-20101006/.git/COMMIT_EDITMSG 2011-02-07 05:37:23.000000000 +0000 +++ iputils-20121221/.git/COMMIT_EDITMSG 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -Update changelog for version 3:20101006-1 -# Please enter the commit message for your changes. Lines starting -# with '#' will be ignored, and an empty message aborts the commit. -# On branch debian -# Changes to be committed: -# (use "git reset HEAD ..." to unstage) -# -# modified: debian/changelog -# -# Untracked files: -# (use "git add ..." to include in what will be committed) -# -# .pc/ diff -Nru iputils-20101006/.git/FETCH_HEAD iputils-20121221/.git/FETCH_HEAD --- iputils-20101006/.git/FETCH_HEAD 2011-02-07 05:09:18.000000000 +0000 +++ iputils-20121221/.git/FETCH_HEAD 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -68cafc1dcf7937748c44060911e80f9c69c4b52f not-for-merge branch 'master' of /home/noahm/src/debian/iputils-git/import/iputils diff -Nru iputils-20101006/.git/HEAD iputils-20121221/.git/HEAD --- iputils-20101006/.git/HEAD 2011-02-07 06:10:56.000000000 +0000 +++ iputils-20121221/.git/HEAD 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -ref: refs/heads/upstream diff -Nru iputils-20101006/.git/ORIG_HEAD iputils-20121221/.git/ORIG_HEAD --- iputils-20101006/.git/ORIG_HEAD 2011-02-07 05:37:31.000000000 +0000 +++ iputils-20121221/.git/ORIG_HEAD 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -b564bfeab314d6325ae4d48ff90873863527c592 diff -Nru iputils-20101006/.git/config iputils-20121221/.git/config --- iputils-20101006/.git/config 2011-02-07 05:09:11.000000000 +0000 +++ iputils-20121221/.git/config 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true -[remote "origin"] - fetch = +refs/heads/*:refs/remotes/origin/* - url = ssh://noahm@git.debian.org/git/collab-maint/iputils.git -[branch "master"] - remote = origin - merge = refs/heads/master -[remote "usagi"] - url = git://www.linux-ipv6.org/gitroot/iputils.git - fetch = +refs/heads/*:refs/remotes/usagi/* -[remote "svn-import"] - url = /home/noahm/src/debian/iputils-git/import/iputils - fetch = +refs/heads/*:refs/remotes/svn-import/* diff -Nru iputils-20101006/.git/description iputils-20121221/.git/description --- iputils-20101006/.git/description 2011-01-24 07:37:34.000000000 +0000 +++ iputils-20121221/.git/description 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff -Nru iputils-20101006/.git/hooks/applypatch-msg.sample iputils-20121221/.git/hooks/applypatch-msg.sample --- iputils-20101006/.git/hooks/applypatch-msg.sample 2011-01-24 07:37:34.000000000 +0000 +++ iputils-20121221/.git/hooks/applypatch-msg.sample 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -test -x "$GIT_DIR/hooks/commit-msg" && - exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} -: diff -Nru iputils-20101006/.git/hooks/commit-msg.sample iputils-20121221/.git/hooks/commit-msg.sample --- iputils-20101006/.git/hooks/commit-msg.sample 2011-01-24 07:37:34.000000000 +0000 +++ iputils-20121221/.git/hooks/commit-msg.sample 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff -Nru iputils-20101006/.git/hooks/post-commit.sample iputils-20121221/.git/hooks/post-commit.sample --- iputils-20101006/.git/hooks/post-commit.sample 2011-01-24 07:37:34.000000000 +0000 +++ iputils-20121221/.git/hooks/post-commit.sample 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script that is called after a successful -# commit is made. -# -# To enable this hook, rename this file to "post-commit". - -: Nothing diff -Nru iputils-20101006/.git/hooks/post-receive.sample iputils-20121221/.git/hooks/post-receive.sample --- iputils-20101006/.git/hooks/post-receive.sample 2011-01-24 07:37:34.000000000 +0000 +++ iputils-20121221/.git/hooks/post-receive.sample 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script for the "post-receive" event. -# -# The "post-receive" script is run after receive-pack has accepted a pack -# and the repository has been updated. It is passed arguments in through -# stdin in the form -# -# For example: -# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master -# -# see contrib/hooks/ for a sample, or uncomment the next line and -# rename the file to "post-receive". - -#. /usr/share/doc/git-core/contrib/hooks/post-receive-email diff -Nru iputils-20101006/.git/hooks/post-update.sample iputils-20121221/.git/hooks/post-update.sample --- iputils-20101006/.git/hooks/post-update.sample 2011-01-24 07:37:34.000000000 +0000 +++ iputils-20121221/.git/hooks/post-update.sample 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff -Nru iputils-20101006/.git/hooks/pre-applypatch.sample iputils-20121221/.git/hooks/pre-applypatch.sample --- iputils-20101006/.git/hooks/pre-applypatch.sample 2011-01-24 07:37:34.000000000 +0000 +++ iputils-20121221/.git/hooks/pre-applypatch.sample 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -test -x "$GIT_DIR/hooks/pre-commit" && - exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"} -: diff -Nru iputils-20101006/.git/hooks/pre-commit.sample iputils-20121221/.git/hooks/pre-commit.sample --- iputils-20101006/.git/hooks/pre-commit.sample 2011-01-24 07:37:34.000000000 +0000 +++ iputils-20121221/.git/hooks/pre-commit.sample 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ascii filenames set this variable to true. -allownonascii=$(git config hooks.allownonascii) - -# Cross platform projects tend to avoid non-ascii filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test "$(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0')" -then - echo "Error: Attempt to add a non-ascii file name." - echo - echo "This can cause problems if you want to work" - echo "with people on other platforms." - echo - echo "To be portable it is advisable to rename the file ..." - echo - echo "If you know what you are doing you can disable this" - echo "check using:" - echo - echo " git config hooks.allownonascii true" - echo - exit 1 -fi - -exec git diff-index --check --cached $against -- diff -Nru iputils-20101006/.git/hooks/pre-rebase.sample iputils-20121221/.git/hooks/pre-rebase.sample --- iputils-20101006/.git/hooks/pre-rebase.sample 2011-01-24 07:37:34.000000000 +0000 +++ iputils-20121221/.git/hooks/pre-rebase.sample 1970-01-01 00:00:00.000000000 +0000 @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up-to-date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -exit 0 - -################################################################ - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". diff -Nru iputils-20101006/.git/hooks/prepare-commit-msg.sample iputils-20121221/.git/hooks/prepare-commit-msg.sample --- iputils-20101006/.git/hooks/prepare-commit-msg.sample 2011-01-24 07:37:34.000000000 +0000 +++ iputils-20121221/.git/hooks/prepare-commit-msg.sample 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first comments out the -# "Conflicts:" part of a merge commit. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -case "$2,$3" in - merge,) - /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; - -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$1" ;; - - *) ;; -esac - -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" diff -Nru iputils-20101006/.git/hooks/update.sample iputils-20121221/.git/hooks/update.sample --- iputils-20101006/.git/hooks/update.sample 2011-01-24 07:37:34.000000000 +0000 +++ iputils-20121221/.git/hooks/update.sample 1970-01-01 00:00:00.000000000 +0000 @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to blocks unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "Usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 Binary files /tmp/8SsI37yP8v/iputils-20101006/.git/index and /tmp/PSkOwFQbXO/iputils-20121221/.git/index differ diff -Nru iputils-20101006/.git/info/exclude iputils-20121221/.git/info/exclude --- iputils-20101006/.git/info/exclude 2011-01-24 07:37:34.000000000 +0000 +++ iputils-20121221/.git/info/exclude 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff -Nru iputils-20101006/.git/logs/HEAD iputils-20121221/.git/logs/HEAD --- iputils-20101006/.git/logs/HEAD 2011-02-07 06:10:56.000000000 +0000 +++ iputils-20121221/.git/logs/HEAD 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -0000000000000000000000000000000000000000 2384927c0ac1bb3ad21966350644d08faadb7a76 Noah Meyerhans 1295856605 -0800 initial pull -2384927c0ac1bb3ad21966350644d08faadb7a76 2384927c0ac1bb3ad21966350644d08faadb7a76 Noah Meyerhans 1296958832 -0800 checkout: moving from master to upstream -2384927c0ac1bb3ad21966350644d08faadb7a76 2384927c0ac1bb3ad21966350644d08faadb7a76 Noah Meyerhans 1296958836 -0800 checkout: moving from upstream to debian -2384927c0ac1bb3ad21966350644d08faadb7a76 2384927c0ac1bb3ad21966350644d08faadb7a76 Noah Meyerhans 1296981857 -0800 checkout: moving from debian to upstream -2384927c0ac1bb3ad21966350644d08faadb7a76 2384927c0ac1bb3ad21966350644d08faadb7a76 Noah Meyerhans 1297017012 -0800 checkout: moving from upstream to debian -2384927c0ac1bb3ad21966350644d08faadb7a76 2384927c0ac1bb3ad21966350644d08faadb7a76 Noah Meyerhans 1297054426 -0800 checkout: moving from debian to upstream -2384927c0ac1bb3ad21966350644d08faadb7a76 2384927c0ac1bb3ad21966350644d08faadb7a76 Noah Meyerhans 1297054454 -0800 checkout: moving from upstream to debian -2384927c0ac1bb3ad21966350644d08faadb7a76 a04859d800ce406464fe111f3382d99c60191ba0 Noah Meyerhans 1297055372 -0800 merge svn-import/master: Merge made by recursive. -a04859d800ce406464fe111f3382d99c60191ba0 2384927c0ac1bb3ad21966350644d08faadb7a76 Noah Meyerhans 1297055643 -0800 checkout: moving from debian to master -2384927c0ac1bb3ad21966350644d08faadb7a76 a04859d800ce406464fe111f3382d99c60191ba0 Noah Meyerhans 1297055652 -0800 merge debian: Fast-forward -a04859d800ce406464fe111f3382d99c60191ba0 a04859d800ce406464fe111f3382d99c60191ba0 Noah Meyerhans 1297055717 -0800 checkout: moving from master to debian -a04859d800ce406464fe111f3382d99c60191ba0 df17b6bdec04f03887c617f7a9af0d41db834d42 Noah Meyerhans 1297055907 -0800 commit: Remove CVE-2010-2529, which is applied upstream. -df17b6bdec04f03887c617f7a9af0d41db834d42 b564bfeab314d6325ae4d48ff90873863527c592 Noah Meyerhans 1297056027 -0800 commit: Remove fix-arp-broadcast-address, which is applied upstream. -b564bfeab314d6325ae4d48ff90873863527c592 a04859d800ce406464fe111f3382d99c60191ba0 Noah Meyerhans 1297056062 -0800 checkout: moving from debian to master -a04859d800ce406464fe111f3382d99c60191ba0 b564bfeab314d6325ae4d48ff90873863527c592 Noah Meyerhans 1297056065 -0800 merge debian: Fast-forward -b564bfeab314d6325ae4d48ff90873863527c592 2384927c0ac1bb3ad21966350644d08faadb7a76 Noah Meyerhans 1297056106 -0800 checkout: moving from master to upstream -2384927c0ac1bb3ad21966350644d08faadb7a76 b564bfeab314d6325ae4d48ff90873863527c592 Noah Meyerhans 1297056117 -0800 checkout: moving from upstream to master -b564bfeab314d6325ae4d48ff90873863527c592 b564bfeab314d6325ae4d48ff90873863527c592 Noah Meyerhans 1297056162 -0800 checkout: moving from master to debian -b564bfeab314d6325ae4d48ff90873863527c592 d24853c8aa8f2d9ec3b1a7066dacb76168a85387 Noah Meyerhans 1297056999 -0800 commit: Update Vcs-* fields to point to git. -d24853c8aa8f2d9ec3b1a7066dacb76168a85387 ba8d4ed0e5e7fff2eb42c1de3c8a5b565157d54e Noah Meyerhans 1297057034 -0800 commit: Update changelog for version 3:20101006-1 -ba8d4ed0e5e7fff2eb42c1de3c8a5b565157d54e b564bfeab314d6325ae4d48ff90873863527c592 Noah Meyerhans 1297057049 -0800 checkout: moving from debian to master -b564bfeab314d6325ae4d48ff90873863527c592 ba8d4ed0e5e7fff2eb42c1de3c8a5b565157d54e Noah Meyerhans 1297057051 -0800 merge debian: Fast-forward -ba8d4ed0e5e7fff2eb42c1de3c8a5b565157d54e 2384927c0ac1bb3ad21966350644d08faadb7a76 Noah Meyerhans 1297059056 -0800 checkout: moving from master to upstream diff -Nru iputils-20101006/.git/logs/refs/heads/debian iputils-20121221/.git/logs/refs/heads/debian --- iputils-20101006/.git/logs/refs/heads/debian 2011-02-07 05:37:23.000000000 +0000 +++ iputils-20121221/.git/logs/refs/heads/debian 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -0000000000000000000000000000000000000000 2384927c0ac1bb3ad21966350644d08faadb7a76 Noah Meyerhans 1296958836 -0800 branch: Created from HEAD -2384927c0ac1bb3ad21966350644d08faadb7a76 a04859d800ce406464fe111f3382d99c60191ba0 Noah Meyerhans 1297055372 -0800 merge svn-import/master: Merge made by recursive. -a04859d800ce406464fe111f3382d99c60191ba0 df17b6bdec04f03887c617f7a9af0d41db834d42 Noah Meyerhans 1297055907 -0800 commit: Remove CVE-2010-2529, which is applied upstream. -df17b6bdec04f03887c617f7a9af0d41db834d42 b564bfeab314d6325ae4d48ff90873863527c592 Noah Meyerhans 1297056027 -0800 commit: Remove fix-arp-broadcast-address, which is applied upstream. -b564bfeab314d6325ae4d48ff90873863527c592 d24853c8aa8f2d9ec3b1a7066dacb76168a85387 Noah Meyerhans 1297056999 -0800 commit: Update Vcs-* fields to point to git. -d24853c8aa8f2d9ec3b1a7066dacb76168a85387 ba8d4ed0e5e7fff2eb42c1de3c8a5b565157d54e Noah Meyerhans 1297057034 -0800 commit: Update changelog for version 3:20101006-1 diff -Nru iputils-20101006/.git/logs/refs/heads/master iputils-20121221/.git/logs/refs/heads/master --- iputils-20101006/.git/logs/refs/heads/master 2011-02-07 05:37:31.000000000 +0000 +++ iputils-20121221/.git/logs/refs/heads/master 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -0000000000000000000000000000000000000000 2384927c0ac1bb3ad21966350644d08faadb7a76 Noah Meyerhans 1295856605 -0800 initial pull -2384927c0ac1bb3ad21966350644d08faadb7a76 a04859d800ce406464fe111f3382d99c60191ba0 Noah Meyerhans 1297055652 -0800 merge debian: Fast-forward -a04859d800ce406464fe111f3382d99c60191ba0 b564bfeab314d6325ae4d48ff90873863527c592 Noah Meyerhans 1297056065 -0800 merge debian: Fast-forward -b564bfeab314d6325ae4d48ff90873863527c592 ba8d4ed0e5e7fff2eb42c1de3c8a5b565157d54e Noah Meyerhans 1297057051 -0800 merge debian: Fast-forward diff -Nru iputils-20101006/.git/logs/refs/heads/upstream iputils-20121221/.git/logs/refs/heads/upstream --- iputils-20101006/.git/logs/refs/heads/upstream 2011-01-24 08:10:25.000000000 +0000 +++ iputils-20121221/.git/logs/refs/heads/upstream 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 2384927c0ac1bb3ad21966350644d08faadb7a76 Noah Meyerhans 1295856625 -0800 branch: Created from master diff -Nru iputils-20101006/.git/logs/refs/remotes/origin/debian iputils-20121221/.git/logs/refs/remotes/origin/debian --- iputils-20101006/.git/logs/refs/remotes/origin/debian 2011-02-07 05:37:37.000000000 +0000 +++ iputils-20121221/.git/logs/refs/remotes/origin/debian 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -0000000000000000000000000000000000000000 a04859d800ce406464fe111f3382d99c60191ba0 Noah Meyerhans 1297055560 -0800 update by push -a04859d800ce406464fe111f3382d99c60191ba0 b564bfeab314d6325ae4d48ff90873863527c592 Noah Meyerhans 1297056045 -0800 update by push -b564bfeab314d6325ae4d48ff90873863527c592 ba8d4ed0e5e7fff2eb42c1de3c8a5b565157d54e Noah Meyerhans 1297057057 -0800 update by push diff -Nru iputils-20101006/.git/logs/refs/remotes/origin/master iputils-20121221/.git/logs/refs/remotes/origin/master --- iputils-20101006/.git/logs/refs/remotes/origin/master 2011-02-07 05:37:37.000000000 +0000 +++ iputils-20121221/.git/logs/refs/remotes/origin/master 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -0000000000000000000000000000000000000000 2384927c0ac1bb3ad21966350644d08faadb7a76 Noah Meyerhans 1297055560 -0800 update by push -2384927c0ac1bb3ad21966350644d08faadb7a76 a04859d800ce406464fe111f3382d99c60191ba0 Noah Meyerhans 1297055666 -0800 update by push -a04859d800ce406464fe111f3382d99c60191ba0 b564bfeab314d6325ae4d48ff90873863527c592 Noah Meyerhans 1297056073 -0800 update by push -b564bfeab314d6325ae4d48ff90873863527c592 ba8d4ed0e5e7fff2eb42c1de3c8a5b565157d54e Noah Meyerhans 1297057057 -0800 update by push diff -Nru iputils-20101006/.git/logs/refs/remotes/origin/upstream iputils-20121221/.git/logs/refs/remotes/origin/upstream --- iputils-20101006/.git/logs/refs/remotes/origin/upstream 2011-02-07 05:12:40.000000000 +0000 +++ iputils-20121221/.git/logs/refs/remotes/origin/upstream 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 2384927c0ac1bb3ad21966350644d08faadb7a76 Noah Meyerhans 1297055560 -0800 update by push diff -Nru iputils-20101006/.git/logs/refs/remotes/svn-import/master iputils-20121221/.git/logs/refs/remotes/svn-import/master --- iputils-20101006/.git/logs/refs/remotes/svn-import/master 2011-02-07 05:09:18.000000000 +0000 +++ iputils-20121221/.git/logs/refs/remotes/svn-import/master 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 68cafc1dcf7937748c44060911e80f9c69c4b52f Noah Meyerhans 1297055358 -0800 fetch svn-import: storing head diff -Nru iputils-20101006/.git/logs/refs/remotes/usagi/master iputils-20121221/.git/logs/refs/remotes/usagi/master --- iputils-20101006/.git/logs/refs/remotes/usagi/master 2011-02-07 04:54:00.000000000 +0000 +++ iputils-20121221/.git/logs/refs/remotes/usagi/master 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 2384927c0ac1bb3ad21966350644d08faadb7a76 Noah Meyerhans 1297054440 -0800 pull usagi: storing head diff -Nru iputils-20101006/.git/logs/refs/remotes/usagi/miscommit-20060927 iputils-20121221/.git/logs/refs/remotes/usagi/miscommit-20060927 --- iputils-20101006/.git/logs/refs/remotes/usagi/miscommit-20060927 2011-02-07 04:54:00.000000000 +0000 +++ iputils-20121221/.git/logs/refs/remotes/usagi/miscommit-20060927 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 4b970978040da6a9dfbdd58c8acbc4c344d096b4 Noah Meyerhans 1297054440 -0800 pull usagi: storing head Binary files /tmp/8SsI37yP8v/iputils-20101006/.git/objects/15/d3ca9affff38d98ccbee7f157cd031e2d4b9a2 and /tmp/PSkOwFQbXO/iputils-20121221/.git/objects/15/d3ca9affff38d98ccbee7f157cd031e2d4b9a2 differ Binary files /tmp/8SsI37yP8v/iputils-20101006/.git/objects/29/e95c931f894570f7a3c815ed851979fd9e3ec3 and /tmp/PSkOwFQbXO/iputils-20121221/.git/objects/29/e95c931f894570f7a3c815ed851979fd9e3ec3 differ Binary files /tmp/8SsI37yP8v/iputils-20101006/.git/objects/41/a4b85211cf4bc4a59111576f400b944d1c9610 and /tmp/PSkOwFQbXO/iputils-20121221/.git/objects/41/a4b85211cf4bc4a59111576f400b944d1c9610 differ diff -Nru iputils-20101006/.git/objects/43/604d07e4f43ebba40b2775a9bd3b6857a4dcc3 iputils-20121221/.git/objects/43/604d07e4f43ebba40b2775a9bd3b6857a4dcc3 --- iputils-20101006/.git/objects/43/604d07e4f43ebba40b2775a9bd3b6857a4dcc3 2011-02-07 05:18:25.000000000 +0000 +++ iputils-20121221/.git/objects/43/604d07e4f43ebba40b2775a9bd3b6857a4dcc3 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -xMA! E]{ -/PcfuLe8PRJ}nw[K FMAyjhN1+A5xV }3&^ N A4Y>vm蹠mC9Q5K; SAؓ{rO \ No newline at end of file Binary files /tmp/8SsI37yP8v/iputils-20101006/.git/objects/48/363fad8c94ef42c32b0d4f51cddcc8881a3c6a and /tmp/PSkOwFQbXO/iputils-20121221/.git/objects/48/363fad8c94ef42c32b0d4f51cddcc8881a3c6a differ Binary files /tmp/8SsI37yP8v/iputils-20101006/.git/objects/54/acf6218a1552fc0bc96437a8b1eb351ed9de07 and /tmp/PSkOwFQbXO/iputils-20121221/.git/objects/54/acf6218a1552fc0bc96437a8b1eb351ed9de07 differ Binary files /tmp/8SsI37yP8v/iputils-20101006/.git/objects/5a/a8f1cff7797502990126d6857a95c4fb7adaca and /tmp/PSkOwFQbXO/iputils-20121221/.git/objects/5a/a8f1cff7797502990126d6857a95c4fb7adaca differ Binary files /tmp/8SsI37yP8v/iputils-20101006/.git/objects/64/2417d5fe37a5da2dff2c88b9b3e7e18337211f and /tmp/PSkOwFQbXO/iputils-20121221/.git/objects/64/2417d5fe37a5da2dff2c88b9b3e7e18337211f differ Binary files /tmp/8SsI37yP8v/iputils-20101006/.git/objects/6a/c3716f4cda61d13ff154bcf5ece52f74e8648a and /tmp/PSkOwFQbXO/iputils-20121221/.git/objects/6a/c3716f4cda61d13ff154bcf5ece52f74e8648a differ Binary files /tmp/8SsI37yP8v/iputils-20101006/.git/objects/75/94aa8b56b07817c8451055b632ba26125ab1e8 and /tmp/PSkOwFQbXO/iputils-20121221/.git/objects/75/94aa8b56b07817c8451055b632ba26125ab1e8 differ Binary files /tmp/8SsI37yP8v/iputils-20101006/.git/objects/75/be63da312c5009129ac54065da0ef51e3f29ee and /tmp/PSkOwFQbXO/iputils-20121221/.git/objects/75/be63da312c5009129ac54065da0ef51e3f29ee differ Binary files /tmp/8SsI37yP8v/iputils-20101006/.git/objects/7a/28e890ef9470c62f5688da556ba85ae112287d and /tmp/PSkOwFQbXO/iputils-20121221/.git/objects/7a/28e890ef9470c62f5688da556ba85ae112287d differ Binary files /tmp/8SsI37yP8v/iputils-20101006/.git/objects/7a/ef04993976daac0702b9d483d4d6d42abc5ad9 and /tmp/PSkOwFQbXO/iputils-20121221/.git/objects/7a/ef04993976daac0702b9d483d4d6d42abc5ad9 differ Binary files /tmp/8SsI37yP8v/iputils-20101006/.git/objects/9b/7c58390ce771d836b1bbb113fdb869a2b74214 and /tmp/PSkOwFQbXO/iputils-20121221/.git/objects/9b/7c58390ce771d836b1bbb113fdb869a2b74214 differ Binary files /tmp/8SsI37yP8v/iputils-20101006/.git/objects/a0/4859d800ce406464fe111f3382d99c60191ba0 and /tmp/PSkOwFQbXO/iputils-20121221/.git/objects/a0/4859d800ce406464fe111f3382d99c60191ba0 differ diff -Nru iputils-20101006/.git/objects/b5/64bfeab314d6325ae4d48ff90873863527c592 iputils-20121221/.git/objects/b5/64bfeab314d6325ae4d48ff90873863527c592 --- iputils-20101006/.git/objects/b5/64bfeab314d6325ae4d48ff90873863527c592 2011-02-07 05:20:37.000000000 +0000 +++ iputils-20121221/.git/objects/b5/64bfeab314d6325ae4d48ff90873863527c592 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -xm @s)`E@rH3HͧX)!wx %aS"`I"jfg 8yzYa= SU;p7%8 fђGOMѣo[ ^GF{|ck/0Nbp0_b]r{z @\ |m)lqܓ00@bq {C"Äk#Ԣ^UZJ|3f,z(/<.Z{B팏1FXJͳS`Qz -TUJ?'<×kR 3`ob;2)8)=|8>3GO"~=4.9.4 libresolv (or, maybe, glibc) -LDLIBS= +# Libraries ADDLIB= +# Linker flags +LDFLAG_STATIC=-Wl,-Bstatic +LDFLAG_DYNAMIC=-Wl,-Bdynamic +LDFLAG_CAP=-lcap +LDFLAG_GNUTLS=-lgnutls-openssl +LDFLAG_CRYPTO=-lcrypto +LDFLAG_IDN=-lidn +LDFLAG_RESOLV=-lresolv +LDFLAG_SYSFS=-lsysfs + +# +# Options +# + +# Capability support (with libcap) [yes|static|no] +USE_CAP=yes +# sysfs support (with libsysfs - deprecated) [no|yes|static] +USE_SYSFS=no +# IDN support (experimental) [no|yes|static] +USE_IDN=no + +# Do not use getifaddrs [no|yes|static] +WITHOUT_IFADDRS=no +# arping default device (e.g. eth0) [] +ARPING_DEFAULT_DEVICE= + +# GNU TLS library for ping6 [yes|no|static] +USE_GNUTLS=yes +# Crypto library for ping6 [shared|static] +USE_CRYPTO=shared +# Resolv library for ping6 [yes|static] +USE_RESOLV=yes +# ping6 source routing (deprecated by RFC5095) [no|yes|RFC3542] +ENABLE_PING6_RTHDR=no -#options if you compile with libc5, and without a bind>=4.9.4 libresolv -# NOT AVAILABLE. Please, use libresolv. +# rdisc server (-r option) support [no|yes] +ENABLE_RDISC_SERVER=no -CC=gcc +# ------------------------------------- # What a pity, all new gccs are buggy and -Werror does not work. Sigh. -#CCOPT=-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g -Werror -CCOPT=-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g -CFLAGS=$(CCOPT) $(GLIBCFIX) $(DEFINES) +# CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -Werror -g +CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -g +CCOPTOPT=-O3 +GLIBCFIX=-D_GNU_SOURCE +DEFINES= +LDLIB= + +FUNC_LIB = $(if $(filter static,$(1)),$(LDFLAG_STATIC) $(2) $(LDFLAG_DYNAMIC),$(2)) + +# USE_GNUTLS: DEF_GNUTLS, LIB_GNUTLS +# USE_CRYPTO: LIB_CRYPTO +ifneq ($(USE_GNUTLS),no) + LIB_CRYPTO = $(call FUNC_LIB,$(USE_GNUTLS),$(LDFLAG_GNUTLS)) + DEF_CRYPTO = -DUSE_GNUTLS +else + LIB_CRYPTO = $(call FUNC_LIB,$(USE_CRYPTO),$(LDFLAG_CRYPTO)) +endif + +# USE_RESOLV: LIB_RESOLV +LIB_RESOLV = $(call FUNC_LIB,$(USE_RESOLV),$(LDFLAG_RESOLV)) + +# USE_CAP: DEF_CAP, LIB_CAP +ifneq ($(USE_CAP),no) + DEF_CAP = -DCAPABILITIES + LIB_CAP = $(call FUNC_LIB,$(USE_CAP),$(LDFLAG_CAP)) +endif + +# USE_SYSFS: DEF_SYSFS, LIB_SYSFS +ifneq ($(USE_SYSFS),no) + DEF_SYSFS = -DUSE_SYSFS + LIB_SYSFS = $(call FUNC_LIB,$(USE_SYSFS),$(LDFLAG_SYSFS)) +endif + +# USE_IDN: DEF_IDN, LIB_IDN +ifneq ($(USE_IDN),no) + DEF_IDN = -DUSE_IDN + LIB_IDN = $(call FUNC_LIB,$(USE_IDN),$(LDFLAG_IDN)) +endif + +# WITHOUT_IFADDRS: DEF_WITHOUT_IFADDRS +ifneq ($(WITHOUT_IFADDRS),no) + DEF_WITHOUT_IFADDRS = -DWITHOUT_IFADDRS +endif +# ENABLE_RDISC_SERVER: DEF_ENABLE_RDISC_SERVER +ifneq ($(ENABLE_RDISC_SERVER),no) + DEF_ENABLE_RDISC_SERVER = -DRDISC_SERVER +endif + +# ENABLE_PING6_RTHDR: DEF_ENABLE_PING6_RTHDR +ifneq ($(ENABLE_PING6_RTHDR),no) + DEF_ENABLE_PING6_RTHDR = -DPING6_ENABLE_RTHDR +ifeq ($(ENABLE_PING6_RTHDR),RFC3542) + DEF_ENABLE_PING6_RTHDR += -DPINR6_ENABLE_RTHDR_RFC3542 +endif +endif + +# ------------------------------------- IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd IPV6_TARGETS=tracepath6 traceroute6 ping6 TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS) -LASTTAG:=`git describe HEAD | sed -e 's/-.*//'` -TAG:=`date +s%Y%m%d` +CFLAGS=$(CCOPTOPT) $(CCOPT) $(GLIBCFIX) $(DEFINES) +LDLIBS=$(LDLIB) $(ADDLIB) + +UNAME_N:=$(shell uname -n) +LASTTAG:=$(shell git describe HEAD | sed -e 's/-.*//') +TODAY=$(shell date +%Y/%m/%d) +DATE=$(shell date --date $(TODAY) +%Y%m%d) +TAG:=$(shell date --date=$(TODAY) +s%Y%m%d) + + +# ------------------------------------- +.PHONY: all ninfod clean distclean man html check-kernel modules snapshot all: $(TARGETS) +%.s: %.c + $(COMPILE.c) $< $(DEF_$(patsubst %.o,%,$@)) -S -o $@ +%.o: %.c + $(COMPILE.c) $< $(DEF_$(patsubst %.o,%,$@)) -o $@ +$(TARGETS): %: %.o + $(LINK.o) $^ $(LIB_$@) $(LDLIBS) -o $@ + +# ------------------------------------- +# arping +DEF_arping = $(DEF_SYSFS) $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) +LIB_arping = $(LIB_SYSFS) $(LIB_CAP) $(LIB_IDN) -tftpd: tftpd.o tftpsubs.o -arping: arping.o -lsysfs -ping: ping.o ping_common.o -ping6: ping6.o ping_common.o -lresolv -lcrypto -ping.o ping6.o ping_common.o: ping_common.h -tftpd.o tftpsubs.o: tftp.h +ifneq ($(ARPING_DEFAULT_DEVICE),) +DEF_arping += -DDEFAULT_DEVICE=\"$(ARPING_DEFAULT_DEVICE)\" +endif -rdisc_srv: rdisc_srv.o +# clockdiff +DEF_clockdiff = $(DEF_CAP) +LIB_clockdiff = $(LIB_CAP) + +# ping / ping6 +DEF_ping_common = $(DEF_CAP) $(DEF_IDN) +DEF_ping = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) +LIB_ping = $(LIB_CAP) $(LIB_IDN) +DEF_ping6 = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) $(DEF_ENABLE_PING6_RTHDR) +LIB_ping6 = $(LIB_CAP) $(LIB_IDN) $(LIB_RESOLV) $(LIB_CRYPTO) + +ping: ping_common.o +ping6: ping_common.o +ping.o ping_common.o: ping_common.h +ping6.o: ping_common.h in6_flowlabel.h + +# rarpd +DEF_rarpd = +LIB_rarpd = + +# rdisc +DEF_rdisc = $(DEF_ENABLE_RDISC_SERVER) +LIB_rdisc = + +# tracepath +DEF_tracepath = $(DEF_IDN) +LIB_tracepath = $(LIB_IDN) + +# tracepath6 +DEF_tracepath6 = $(DEF_IDN) +LIB_tracepath6 = + +# traceroute6 +DEF_traceroute6 = $(DEF_CAP) $(DEF_IDN) +LIB_traceroute6 = $(LIB_CAP) $(LIB_IDN) + +# tftpd +DEF_tftpd = +DEF_tftpsubs = +LIB_tftpd = -rdisc_srv.o: rdisc.c - $(CC) $(CFLAGS) -DRDISC_SERVER -o rdisc_srv.o rdisc.c +tftpd: tftpsubs.o +tftpd.o tftpsubs.o: tftp.h +# ------------------------------------- +# ninfod +ninfod: + @set -e; \ + if [ ! -f ninfod/Makefile ]; then \ + cd ninfod; \ + ./configure; \ + cd ..; \ + fi; \ + $(MAKE) -C ninfod +# ------------------------------------- +# modules / check-kernel are only for ancient kernels; obsolete check-kernel: ifeq ($(KERNEL_INCLUDE),) @echo "Please, set correct KERNEL_INCLUDE"; false @@ -51,6 +210,7 @@ modules: check-kernel $(MAKE) KERNEL_INCLUDE=$(KERNEL_INCLUDE) -C Modules +# ------------------------------------- man: $(MAKE) -C doc man @@ -61,16 +221,29 @@ @rm -f *.o $(TARGETS) @$(MAKE) -C Modules clean @$(MAKE) -C doc clean + @set -e; \ + if [ -f ninfod/Makefile ]; then \ + $(MAKE) -C ninfod clean; \ + fi + +distclean: clean + @set -e; \ + if [ -f ninfod/Makefile ]; then \ + $(MAKE) -C ninfod distclean; \ + fi +# ------------------------------------- snapshot: - @if [ "`uname -n`" != "takos" ]; then echo "Not authorized to advance snapshot"; exit 1; fi - @date "+[$(TAG)]" > RELNOTES.NEW + @if [ x"$(UNAME_N)" != x"pleiades" ]; then echo "Not authorized to advance snapshot"; exit 1; fi + @echo "[$(TAG)]" > RELNOTES.NEW @echo >>RELNOTES.NEW - @git log $(LASTTAG).. | git shortlog >> RELNOTES.NEW + @git log --no-merges $(LASTTAG).. | git shortlog >> RELNOTES.NEW @echo >> RELNOTES.NEW @cat RELNOTES >> RELNOTES.NEW @mv RELNOTES.NEW RELNOTES - @date "+static char SNAPSHOT[] = \"$(TAG)\";" > SNAPSHOT.h + @sed -e "s/^%define ssdate .*/%define ssdate $(DATE)/" iputils.spec > iputils.spec.tmp + @mv iputils.spec.tmp iputils.spec + @echo "static char SNAPSHOT[] = \"$(TAG)\";" > SNAPSHOT.h @$(MAKE) -C doc snapshot @$(MAKE) man @git commit -a -m "iputils-$(TAG)" diff -Nru iputils-20101006/RELNOTES iputils-20121221/RELNOTES --- iputils-20101006/RELNOTES 2011-01-24 08:10:05.000000000 +0000 +++ iputils-20121221/RELNOTES 2012-12-21 14:01:07.000000000 +0000 @@ -1,3 +1,261 @@ +[s20121221] + +YOSHIFUJI Hideaki (14): + ninfod: Use unsigned int for digest. + ninfod: nanosleep(3) needs . + ninfod: Too many arguments for syslog(3)/fprintf(3) via DEBUG(). + ninfod: Fix several warnings on ununsed variables. + ping6: Print unknown ICMP type. + ping6: Fix flowlabel switch (-F option). + arping: Fix sysfs decimal/hexadecimal parser for libsysfs support. + ping6: Use GNU TLS by default. + ninfod: Fix memory leakage in error path. + ninfod: Fix off-by-one error to check possible programming error (again). + ninfod: Do not expose freed buffer to caller. + ping6: Ensure to initialize msghdr. + ninfod: Support GNU TLS. + ninfod: Allow printing usage without permission errors. + + +[s20121207] + +YOSHIFUJI Hideaki (2): + RELNOTES: Typos. + ping,ping6: Check outgoing device only if specified. + + +[s20121205] + +Jan Synacek (1): + ping,tracepath doc: Fix missing end tags. + +YOSHIFUJI Hideaki (35): + tracepath6: packet length option (-l) did not have any effect. + tracepath,tracepath6: Fix pktlen message. + tracepath,tracepath6: Use calloc(3) instead of using stack. + tracepath6: Ignore families other than IPv4 and IPv6. + ping6: Improve randomness of NI Nonce. + tracepath,tracepath6 doc: Fix default pktlen. + ping,rdisc: Optimize checksumming. + makefile: Static link support for crypto, resolv, cap and sysfs. + doc: Ajdust spaces around sqare brackets. + ping,rdisc: Use macro to get odd byte when checksumming. + ping6: Do not try to free memory pointed by uninitialized variable on error path. + arping: Allow building without default interface. + arping: No default interface by default. + arping: Allow printing usage without permission errors. + ping,ping6: Allow printing usage without permission errors. + ping,ping6: Fix cap_t leakage. + arping,ping,ping6: Do not ideologically check return value from cap_free,cap_{set,get}_flag(). + arping: Fix sysfs_class leakage on error path. + arping: Some comments for new functions for finding devices support. + arping: Typo in type declaration. + makefile: Use call function for external libraries. + makefile: Add more comments. + arping: Ensure to fail if no appropriate device found with sysfs. + arping: Enforce user to specify device (-I) if multiple devices found. + Makefile: parameterize options for linking libraries. + Makefile: Use shell function instead if backquotes. + Makefile: Ensure to have same date when making snapshot. + spec: Maintainer does not use ipsec.spec. + spec: partially sync with fedora. + Makefile: Bump date in iputils.spec as well. + spec: Add exmple lines for suid-root installation + spec: Sort changelog. + ping: Exit on SO_BINDTODEVICE failure. + ping: Warn if kernel has selected source address from other interface. + ping: Clarify difference between -I device and -I addr. + + +[s20121126] + +YOSHIFUJI Hideaki (5): + tracepath: Repair tracepath without -p option. + tracepath,tracepath6: -p option in usage. + ping,ping6: Use MAX_DUP_CHK directly, not using mx_dup_chk variable. + ping,ping6: Abstract received bitmap macros/definitions. + ping,ping6: Use __u64 or __u32 for bitmap. + + +[s20121125] + +YOSHIFUJI Hideaki (30): + ping6: Use IN6_IS_ADDR_UNSPECIFIED() instead of our own helper function. + ping6 doc: Explicitly describe ping6 is IPv6 version if ping. + ping6: Deprecate source routing by default (RFC5095). + ping6: Use RFC3542 functions and definition for source routing. + ping6: Introduce niquery_is_enabled() for readability. + arping doc: interface is optional (-I option). + ping: Eliminate dirty hack to cope with ancient egcs bug. + Makefile: Fix missing right parenthes in comment. + arping: Fix build failure with USE_SYSFS=yes and/or WITHOUT_IFADDRS=yes + arping: Unify source files. + arping: Reorder functions and comment out unsued code. + arping,ping,ping6,tracepath,traceroute6 Makefile: Support static link of libidn by USE_IDN=static. + Makefile: Minimize statically linked libraries. + ping6: Do not clear seq check array twice for NI. + ping6: Use MD5_DIGEST_LENGTH instead of magic value 16. + ping6: Introduce helper functions for nonce in NI. + ping6: Introduce NI_NONCE_SIZE macro instead of magic value 8. + ping6: Ensure to call srand() to get some randomness in NI Nonce. + ping6: Generate different NI Nonce in each NI Query (Memory version). + ping6: Generate different NI Nonce in each NI Query (MD5 version). + ping6: Cache NI Nonce. + ping6: Print 'sequence number' embedded in NI Nonce. + ninfod: Do noy try to memcpy to self. + ninfod Makefile: More precise dependencies. + ninfod: Discard multicat packet outside linklocal scope. + ninfod: Apply default policy to refuse queries from global addresses. + ninfod: Normalize timespec for delay. + ninfod: Fix double-free without pthreads. + ninfod: Do not mix output from multiple threads. + ninfod: Employ internal buffer in stderrlog() for common case. + + +[s20121121] + +Jan Synacek (2): + ping,ping6: Add newline to error message. + ping: Don't free an unintialized value. + +YOSHIFUJI Hideaki (31): + arping,clockdiff,ping,rarpd,rdisc,traceroute6 doc: s/CAP_NET_RAWIO/CAP_NET_RAW/. + ping,ping6: Do not assume radix point is denoted by '.' (-i option). + arping,ping,ping6,rdisc,traceroute6: Fix version string. + makefile: Give -fno-strict-aliasing to compiler by default. + ping6: Use SCOPE_DELIMITER. + Makefile: Remove -lm from ADDLIB. + rdisc_srv,Makefile: Fix build. + rdisc_srv,Makefile: Build rdisc_srv with make all. + arping: set_device_broadcast() does not need to store return value of sub-functions. + arping,Makefile: Make default interface configurable. + arping: Do not allow empty device name (-I option). + arping: Introduce check_ifflags() helper function. + arping: Introduce device structure to hold output device information. + arping: ALlow no default interface and select one by getifaddrs(). + arping: Introduce 2nd (legacy) method to select interface by ioctls. + arping,Makefile: Allow build without getifaddrs() with WITHOUT_IFADDRS=yes. + Makefile: Use $< instead of $^ to complile C source code. + ping,ping6: Reorder command-line options in alphabetical order. + ping6: Show suboptions for Node Information Queries if -N suboption is invalid. + ping,ping6 doc: Readability for TOS (-Q) option. + rdisc: Missing new line after usage. + rdisc: Make rdisc with responder support if configured. + Makefile: distclean depends on clean. + Makefile: Default to -O3. + Makefile: Minimize options to gcc. + Makefile: Add rule to build assembly files. + arping,Makefile: 3rd legacy implementation to check network devices. + arping: Less ifdefs. + rdisc doc: Document -r, -p and -T options. + ping6: NI Subjecet address did not work (-N subject-{ipv6,ipv4] suboptions). + ping6: Ensure to detect subject type conflicts. + + +[s20121114] + +Jan Synacek (2): + clockdiff: remove unused variable + ping: Wrap SO_BINDTODEVICE with the correct capability. + +YOSHIFUJI Hideaki (13): + ping: IP_MULTICAST_IF does not need CAP_NET_RAW. + ping6: Check ranges of flowlabel (-F option) and tclass (-Q option) arguments. + ping6: Accept 0x-notation for flowlabel (-F option) and tclass (-Q option) arguments. + ping,ping6: Manual update regarding -F, -Q and -N option. + arping,ping,ping6: Defer exitting to allow users to see usage. + arping,ping,ping6,ninfod: Change euid to uid (non-root) even if capabiliy is enabled. + ninfod: Add configure. + ninfod: libcap support to drop capabilities. + ninfod: Add run as user (-u user) option. + ninfod: Fix usage message. + arping,clockdiff,rarpd,rdisc,tftpd: Change RFC source to tools.ietf.org. + ninfod: Add ninfod(8) manpage. + makefile: Add ninfod, distclean targets. + + +[s20121112] + +Sergey Fionov (1): + ping,ping6: Fallback to numeric addresses while exiting + +YOSHIFUJI Hideaki (18): + ping,ping6: Rework capability support and Make sure -m and -I options work. + ping,tracepath: Spelling fixes in manpages. + ping,ping6: Fix integer overflow with large interval value (-i option). + clockdiff: Make it work with large pid. + ping,ping6: Make in_pr_addr volatile. + arping: Do not quit too early with large deadline value (-w option). + arping: Maintain minimum capabilities for SO_BINDTODEVICE(-I option). + ping: Fix recorded route comparison. + arping: Use getifaddrs() to get broadcast address. + ping6: Fix typo in error message. + ping6: Generate NI Group Address and Subject Name at once. + ping,ping6: Unmask signals on start-up. + arping: Build with USE_CAP=no. + arping,ping,ping6,tracepath,tracepath6,traceroute6: Experimental IDN support. + ping6: IDN support for the Subject Name in NI Query. + tracepath,tracepath6: Introduce -p option for port. + ping6: Add missing definitions/declarations for flowlabel management (-F option). + makefile: Do not include merge commits in RELNOTES. + + +[s20121106] + +YOSHIFUJI Hideaki (5): + ninfod: Attatch configure and renew config.h.in. + makefile: clean-up + tracepath6: Print reason on getadrinfo() failure. + ping,ping6: Fix hang with -f option. + ping: Make sure to print C if checksum failed with -f option. + + +[s20121011] + +Jan Synacek (2): + ping,ping6: Defer the dropping if the "-m" is specified and correct capability is set. + ping: Fix typo in echo reply + +Ole Bjorn Hessen (1): + ping: report outstanding packets before sending next packet + +YOSHIFUJI Hideaki (32): + ping,ping6: Add -D to synopsis. + ping: More icmp code descriptions. + ping,ping6: Hide ipg/ewma info without packets received. + ping6: Remove unused variable. + ping6: Help for -N suboptions. + tracepath,tracepath6: Use argument type of int for field width specifier. + clockdiff: Call nice() before changing effective uid. + rdisc: Use fputs() instead of fprintf() to shut up gcc warning. + rarpd: Check return value of chdir(). + makefile: Introduce new variable for capability support. + ping,ping6: Check return value of write(2) for stdout. + ping6,tracepath,tracepath6: Do not dereference type-punned pointer directly. + Makefile: host changed from takos to pleiades. + ping6: Provide enough buffer for dn_comp() and make NI Query with Name subject work. + ping6: Consolidate error path of niquery_option_subject_name_handler(). + ninfod: Node Information Query (RFC4620) daemon from USAGI Project. + ninfod: struct in6_pktinfo requires -D_GNU_SOURCE. + ninfod: Use %zu format string for size_t variable. + ninfod: Add missing entry for ENABLE_SUPTYPES in config.h.in. + ninfod: Support newer environment supporting RFC3542. + ninfod: Fix format string for string returned from strerror(3). + ninfod: Check return value of fscanf(3). + ninfod: Fix off-by-one error to check possible programming error. + ninfod: Add datarootdir. + ninfod: Use __func__ instead of __FUNCTION__. + ninfod: Introduce ARRAY_SIZE macro for counting number of elements in an array. + ninfod: Delete ninfod.sh by make distclean, not by make clean. + ping6: Do not try to use result buffer when dn_comp(3) failed. + ping,ping6: ifdef guard for inline function for capability support and fix build with USE_CAP=no. + makefile: Do not use "-llib" dependency. + arping: build without sysfs support (USE_SYSFS=no). + +Ángel González (1): + iputils: Add capability dropping + + [s20101006] Chris Caputo (1): @@ -16,8 +274,6 @@ [s20100418] YOSHIFUJI Hideaki (28): - Merge branch 'timestamp' - Merge branch 'miscommit-20100210' ping6: Use IPV6_TCLASS to set outgoing traffic class if available. ping: Make build_echo(), gather_statistics() more generic. ping6: Experimental support for Node Information Queries (RFC4620). @@ -66,7 +322,6 @@ tracepath: Fix documentation typo. Use sysconf(_SC_OPEN_MAX) instead of OPEN_MAX. ping,ping6: Add -D option to print timestamp. - Merge branch 'timestamp' [s20071127] @@ -105,7 +360,6 @@ [TRACEPATH] Print usage if we met incorrect option. [PING6]: Fix compilation error with glibc-2.4 and later. [PING6]: Use getaddrinfo() to allow scoped addresses - Merge branch 'miscommit-20060927' [PING6]: Ensure not to reverse-lookup if target is numeric address. diff -Nru iputils-20101006/SNAPSHOT.h iputils-20121221/SNAPSHOT.h --- iputils-20101006/SNAPSHOT.h 2011-01-24 08:10:05.000000000 +0000 +++ iputils-20121221/SNAPSHOT.h 2012-12-21 14:01:07.000000000 +0000 @@ -1 +1 @@ -static char SNAPSHOT[] = "s20101006"; +static char SNAPSHOT[] = "s20121221"; diff -Nru iputils-20101006/arping.c iputils-20121221/arping.c --- iputils-20101006/arping.c 2011-02-07 05:20:53.000000000 +0000 +++ iputils-20121221/arping.c 2012-12-21 14:01:07.000000000 +0000 @@ -7,6 +7,7 @@ * 2 of the License, or (at your option) any later version. * * Authors: Alexey Kuznetsov, + * YOSHIFUJI Hideaki */ #include @@ -17,11 +18,15 @@ #include #include #include -#include +#include #include #include #include #include +#ifdef CAPABILITIES +#include +#include +#endif #include #include @@ -32,15 +37,45 @@ #include #include +#ifdef USE_SYSFS #include +struct sysfs_devattr_values; +#endif + +#ifndef WITHOUT_IFADDRS +#include +#endif + +#ifdef USE_IDN +#include +#include +#endif #include "SNAPSHOT.h" static void usage(void) __attribute__((noreturn)); +#ifdef DEFAULT_DEVICE +# define DEFAULT_DEVICE_STR DEFAULT_DEVICE +#else +# define DEFAULT_DEVICE NULL +#endif + +struct device { + char *name; + int ifindex; +#ifndef WITHOUT_IFADDRS + struct ifaddrs *ifa; +#endif +#ifdef USE_SYSFS + struct sysfs_devattr_values *sysfs; +#endif +}; + int quit_on_reply=0; -char *device="eth0"; -int ifindex; +struct device device = { + .name = DEFAULT_DEVICE, +}; char *source; struct in_addr src, dst; char *target; @@ -60,6 +95,10 @@ int sent, brd_sent; int received, brd_recv, req_recv; +#ifndef CAPABILITIES +static uid_t euid; +#endif + #define MS_TDIFF(tv1,tv2) ( ((tv1).tv_sec-(tv2).tv_sec)*1000 + \ ((tv1).tv_usec-(tv2).tv_usec)/1000 ) @@ -88,7 +127,11 @@ " -V : print version and exit\n" " -c count : how many packets to send\n" " -w timeout : how long to wait for a reply\n" - " -I device : which ethernet device to use (eth0)\n" + " -I device : which ethernet device to use" +#ifdef DEFAULT_DEVICE_STR + " (" DEFAULT_DEVICE_STR ")" +#endif + "\n" " -s source : source ip address\n" " destination : ask for what ip address\n" ); @@ -105,6 +148,125 @@ sigaction(signo, &sa, NULL); } +#ifdef CAPABILITIES +static const cap_value_t caps[] = { CAP_NET_RAW, }; +static cap_flag_value_t cap_raw = CAP_CLEAR; +#endif + +void limit_capabilities(void) +{ +#ifdef CAPABILITIES + cap_t cap_p; + + cap_p = cap_get_proc(); + if (!cap_p) { + perror("arping: cap_get_proc"); + exit(-1); + } + + cap_get_flag(cap_p, CAP_NET_RAW, CAP_PERMITTED, &cap_raw); + + if (cap_raw != CAP_CLEAR) { + if (cap_clear(cap_p) < 0) { + perror("arping: cap_clear"); + exit(-1); + } + + cap_set_flag(cap_p, CAP_PERMITTED, 1, caps, CAP_SET); + + if (cap_set_proc(cap_p) < 0) { + perror("arping: cap_set_proc"); + if (errno != EPERM) + exit(-1); + } + } + + if (prctl(PR_SET_KEEPCAPS, 1) < 0) { + perror("arping: prctl"); + exit(-1); + } + + if (setuid(getuid()) < 0) { + perror("arping: setuid"); + exit(-1); + } + + if (prctl(PR_SET_KEEPCAPS, 0) < 0) { + perror("arping: prctl"); + exit(-1); + } + + cap_free(cap_p); +#else + euid = geteuid(); +#endif +} + +int modify_capability_raw(int on) +{ +#ifdef CAPABILITIES + cap_t cap_p; + + if (cap_raw != CAP_SET) + return on ? -1 : 0; + + cap_p = cap_get_proc(); + if (!cap_p) { + perror("arping: cap_get_proc"); + return -1; + } + + cap_set_flag(cap_p, CAP_EFFECTIVE, 1, caps, on ? CAP_SET : CAP_CLEAR); + + if (cap_set_proc(cap_p) < 0) { + perror("arping: cap_set_proc"); + return -1; + } + + cap_free(cap_p); +#else + if (setuid(on ? euid : getuid())) { + perror("arping: setuid"); + return -1; + } +#endif + return 0; +} + +static inline int enable_capability_raw(void) +{ + return modify_capability_raw(1); +} + +static inline int disable_capability_raw(void) +{ + return modify_capability_raw(0); +} + +void drop_capabilities(void) +{ +#ifdef CAPABILITIES + cap_t cap_p = cap_init(); + + if (!cap_p) { + perror("arping: cap_init"); + exit(-1); + } + + if (cap_set_proc(cap_p) < 0) { + perror("arping: cap_set_proc"); + exit(-1); + } + + cap_free(cap_p); +#else + if (setuid(getuid()) < 0) { + perror("arping: setuid"); + exit(-1); + } +#endif +} + int send_pack(int s, struct in_addr src, struct in_addr dst, struct sockaddr_ll *ME, struct sockaddr_ll *HE) { @@ -175,17 +337,24 @@ void catcher(void) { - struct timeval tv; + struct timeval tv, tv_s, tv_o; gettimeofday(&tv, NULL); if (start.tv_sec==0) start = tv; - if (count-- == 0 || (timeout && MS_TDIFF(tv,start) > timeout*1000 + 500)) + timersub(&tv, &start, &tv_s); + tv_o.tv_sec = timeout; + tv_o.tv_usec = 500 * 1000; + + if (count-- == 0 || (timeout && timercmp(&tv_s, &tv_o, >))) finish(); - if (last.tv_sec==0 || MS_TDIFF(tv,last) > 500) { + timersub(&tv, &last, &tv_s); + tv_o.tv_sec = 0; + + if (last.tv_sec==0 || timercmp(&tv_s, &tv_o, >)) { send_pack(s, src, dst, (struct sockaddr_ll *)&me, (struct sockaddr_ll *)&he); if (count == 0 && unsolicited) @@ -311,34 +480,517 @@ return 1; } -void set_device_broadcast(char *device, unsigned char *ba, size_t balen) +#ifdef USE_SYSFS +union sysfs_devattr_value { + unsigned long ulong; + void *ptr; +}; + +enum { + SYSFS_DEVATTR_IFINDEX, + SYSFS_DEVATTR_FLAGS, + SYSFS_DEVATTR_ADDR_LEN, +#if 0 + SYSFS_DEVATTR_TYPE, + SYSFS_DEVATTR_ADDRESS, +#endif + SYSFS_DEVATTR_BROADCAST, + SYSFS_DEVATTR_NUM +}; + +struct sysfs_devattr_values +{ + char *ifname; + union sysfs_devattr_value value[SYSFS_DEVATTR_NUM]; +}; + +static int sysfs_devattr_ulong_dec(char *ptr, struct sysfs_devattr_values *v, unsigned idx); +static int sysfs_devattr_ulong_hex(char *ptr, struct sysfs_devattr_values *v, unsigned idx); +static int sysfs_devattr_macaddr(char *ptr, struct sysfs_devattr_values *v, unsigned idx); + +struct sysfs_devattrs { + const char *name; + int (*handler)(char *ptr, struct sysfs_devattr_values *v, unsigned int idx); + int free; +} sysfs_devattrs[SYSFS_DEVATTR_NUM] = { + [SYSFS_DEVATTR_IFINDEX] = { + .name = "ifindex", + .handler = sysfs_devattr_ulong_dec, + }, + [SYSFS_DEVATTR_ADDR_LEN] = { + .name = "addr_len", + .handler = sysfs_devattr_ulong_dec, + }, + [SYSFS_DEVATTR_FLAGS] = { + .name = "flags", + .handler = sysfs_devattr_ulong_hex, + }, +#if 0 + [SYSFS_DEVATTR_TYPE] = { + .name = "type", + .handler = sysfs_devattr_ulong_dec, + }, + [SYSFS_DEVATTR_ADDRESS] = { + .name = "address", + .handler = sysfs_devattr_macaddr, + .free = 1, + }, +#endif + [SYSFS_DEVATTR_BROADCAST] = { + .name = "broadcast", + .handler = sysfs_devattr_macaddr, + .free = 1, + }, +}; +#endif + +/* + * find_device() + * + * This function checks 1) if the device (if given) is okay for ARP, + * or 2) find fist appropriate device on the system. + * + * Return value: + * >0 : Succeeded, and appropriate device not found. + * device.ifindex remains 0. + * 0 : Succeeded, and approptiate device found. + * device.ifindex is set. + * <0 : Failed. Support not found, or other + * : system error. Try other method. + * + * If an appropriate device found, it is recorded inside the + * "device" variable for later reference. + * + * We have several implementations for this. + * by_ifaddrs(): requires getifaddr() in glibc, and rtnetlink in + * kernel. default and recommended for recent systems. + * by_sysfs(): requires libsysfs , and sysfs in kernel. + * by_ioctl(): unable to list devices without ipv4 address; this + * means, you need to supply the device name for + * DAD purpose. + */ +/* Common check for ifa->ifa_flags */ +static int check_ifflags(unsigned int ifflags, int fatal) +{ + if (!(ifflags & IFF_UP)) { + if (fatal) { + if (!quiet) + printf("Interface \"%s\" is down\n", device.name); + exit(2); + } + return -1; + } + if (ifflags & (IFF_NOARP | IFF_LOOPBACK)) { + if (fatal) { + if (!quiet) + printf("Interface \"%s\" is not ARPable\n", device.name); + exit(dad ? 0 : 2); + } + return -1; + } + return 0; +} + +static int find_device_by_ifaddrs(void) +{ +#ifndef WITHOUT_IFADDRS + int rc; + struct ifaddrs *ifa0, *ifa; + int count = 0; + + rc = getifaddrs(&ifa0); + if (rc) { + perror("getifaddrs"); + return -1; + } + + for (ifa = ifa0; ifa; ifa = ifa->ifa_next) { + if (!ifa->ifa_addr) + continue; + if (ifa->ifa_addr->sa_family != AF_PACKET) + continue; + if (device.name && ifa->ifa_name && strcmp(ifa->ifa_name, device.name)) + continue; + + if (check_ifflags(ifa->ifa_flags, device.name != NULL) < 0) + continue; + + if (!((struct sockaddr_ll *)ifa->ifa_addr)->sll_halen) + continue; + if (!ifa->ifa_broadaddr) + continue; + + device.ifa = ifa; + + if (count++) + break; + } + + if (count == 1 && device.ifa) { + device.ifindex = if_nametoindex(device.ifa->ifa_name); + if (!device.ifindex) { + perror("arping: if_nametoindex"); + freeifaddrs(ifa0); + return -1; + } + device.name = device.ifa->ifa_name; + return 0; + } + return 1; +#else + return -1; +#endif +} + +#ifdef USE_SYSFS +static void sysfs_devattr_values_init(struct sysfs_devattr_values *v, int do_free) +{ + int i; + if (do_free) { + free(v->ifname); + for (i = 0; i < SYSFS_DEVATTR_NUM; i++) { + if (sysfs_devattrs[i].free) + free(v->value[i].ptr); + } + } + memset(v, 0, sizeof(*v)); +} + +static int sysfs_devattr_ulong(char *ptr, struct sysfs_devattr_values *v, unsigned int idx, + unsigned int base) { + unsigned long *p; + char *ep; + + if (!ptr || !v) + return -1; + + p = &v->value[idx].ulong; + errno = 0; + *p = strtoul(ptr, &ep, base); + if ((*ptr && isspace(*ptr & 0xff)) || errno || (*ep != '\0' && *ep != '\n')) + goto out; + + return 0; +out: + return -1; +} + +static int sysfs_devattr_ulong_dec(char *ptr, struct sysfs_devattr_values *v, unsigned int idx) +{ + int rc = sysfs_devattr_ulong(ptr, v, idx, 10); + return rc; +} + +static int sysfs_devattr_ulong_hex(char *ptr, struct sysfs_devattr_values *v, unsigned int idx) +{ + int rc = sysfs_devattr_ulong(ptr, v, idx, 16); + return rc; +} + +static int sysfs_devattr_macaddr(char *ptr, struct sysfs_devattr_values *v, unsigned int idx) +{ + unsigned char *m; + int i; + unsigned int addrlen; + + if (!ptr || !v) + return -1; + + addrlen = v->value[SYSFS_DEVATTR_ADDR_LEN].ulong; + m = malloc(addrlen); + + for (i = 0; i < addrlen; i++) { + if (i && *(ptr + i * 3 - 1) != ':') + goto out; + if (sscanf(ptr + i * 3, "%02hhx", &m[i]) != 1) + goto out; + } + + v->value[idx].ptr = m; + return 0; +out: + free(m); + return -1; +} +#endif + +int find_device_by_sysfs(void) +{ + int rc = -1; +#ifdef USE_SYSFS + struct sysfs_class *cls_net; + struct dlist *dev_list; struct sysfs_class_device *dev; - struct sysfs_attribute *brdcast; - unsigned char *p; - int ch; + struct sysfs_attribute *dev_attr; + struct sysfs_devattr_values sysfs_devattr_values; + int count = 0; - dev = sysfs_open_class_device("net", device); - if (!dev) { - perror("sysfs_open_class_device(net)"); - exit(2); + if (!device.sysfs) { + device.sysfs = malloc(sizeof(*device.sysfs)); + sysfs_devattr_values_init(device.sysfs, 0); } - brdcast = sysfs_get_classdev_attr(dev, "broadcast"); - if (!brdcast) { - perror("sysfs_get_classdev_attr(broadcast)"); - exit(2); + cls_net = sysfs_open_class("net"); + if (!cls_net) { + perror("sysfs_open_class"); + return -1; } - if (sysfs_read_attribute(brdcast)) { - perror("sysfs_read_attribute"); - exit(2); + dev_list = sysfs_get_class_devices(cls_net); + if (!dev_list) { + perror("sysfs_get_class_devices"); + goto out; + } + + sysfs_devattr_values_init(&sysfs_devattr_values, 0); + + dlist_for_each_data(dev_list, dev, struct sysfs_class_device) { + int i; + int rc = -1; + + if (device.name && strcmp(dev->name, device.name)) + goto do_next; + + sysfs_devattr_values_init(&sysfs_devattr_values, 1); + + for (i = 0; i < SYSFS_DEVATTR_NUM; i++) { + + dev_attr = sysfs_get_classdev_attr(dev, sysfs_devattrs[i].name); + if (!dev_attr) { + perror("sysfs_get_classdev_attr"); + rc = -1; + break; + } + if (sysfs_read_attribute(dev_attr)) { + perror("sysfs_read_attribute"); + rc = -1; + break; + } + rc = sysfs_devattrs[i].handler(dev_attr->value, &sysfs_devattr_values, i); + + if (rc < 0) + break; + } + + if (rc < 0) + goto do_next; + + if (check_ifflags(sysfs_devattr_values.value[SYSFS_DEVATTR_FLAGS].ulong, + device.name != NULL) < 0) + goto do_next; + + if (!sysfs_devattr_values.value[SYSFS_DEVATTR_ADDR_LEN].ulong) + goto do_next; + + if (device.sysfs->value[SYSFS_DEVATTR_IFINDEX].ulong) { + if (device.sysfs->value[SYSFS_DEVATTR_FLAGS].ulong & IFF_RUNNING) + goto do_next; + } + + sysfs_devattr_values.ifname = strdup(dev->name); + if (!sysfs_devattr_values.ifname) { + perror("malloc"); + goto out; + } + + sysfs_devattr_values_init(device.sysfs, 1); + memcpy(device.sysfs, &sysfs_devattr_values, sizeof(*device.sysfs)); + sysfs_devattr_values_init(&sysfs_devattr_values, 0); + + if (count++) + break; + + continue; +do_next: + sysfs_devattr_values_init(&sysfs_devattr_values, 1); + } + + if (count == 1) { + device.ifindex = device.sysfs->value[SYSFS_DEVATTR_IFINDEX].ulong; + device.name = device.sysfs->ifname; + } + rc = !device.ifindex; +out: + sysfs_close_class(cls_net); +#endif + return rc; +} + +static int check_device_by_ioctl(int s, struct ifreq *ifr) +{ + if (ioctl(s, SIOCGIFFLAGS, ifr) < 0) { + perror("ioctl(SIOCGIFINDEX"); + return -1; + } + + if (check_ifflags(ifr->ifr_flags, device.name != NULL) < 0) + return 1; + + if (ioctl(s, SIOCGIFINDEX, ifr) < 0) { + perror("ioctl(SIOCGIFINDEX"); + return -1; + } + + return 0; +} + +static int find_device_by_ioctl(void) +{ + int s; + struct ifreq *ifr0, *ifr, *ifr_end; + size_t ifrsize = sizeof(*ifr); + struct ifconf ifc; + static struct ifreq ifrbuf; + int count = 0; + + s = socket(AF_INET, SOCK_DGRAM, 0); + if (s < 0) { + perror("socket"); + return -1; + } + + memset(&ifrbuf, 0, sizeof(ifrbuf)); + + if (device.name) { + strncpy(ifrbuf.ifr_name, device.name, sizeof(ifrbuf.ifr_name) - 1); + if (check_device_by_ioctl(s, &ifrbuf)) + goto out; + count++; + } else { + do { + int rc; + ifr0 = malloc(ifrsize); + if (!ifr0) { + perror("malloc"); + goto out; + } + + ifc.ifc_buf = (char *)ifr0; + ifc.ifc_len = ifrsize; + + rc = ioctl(s, SIOCGIFCONF, &ifc); + if (rc < 0) { + perror("ioctl(SIOCFIFCONF"); + goto out; + } + + if (ifc.ifc_len + sizeof(*ifr0) + sizeof(struct sockaddr_storage) - sizeof(struct sockaddr) <= ifrsize) + break; + ifrsize *= 2; + free(ifr0); + ifr0 = NULL; + } while(ifrsize < INT_MAX / 2); + + if (!ifr0) { + fprintf(stderr, "arping: too many interfaces!?\n"); + goto out; + } + + ifr_end = (struct ifreq *)(((char *)ifr0) + ifc.ifc_len - sizeof(*ifr0)); + for (ifr = ifr0; ifr <= ifr_end; ifr++) { + if (check_device_by_ioctl(s, &ifrbuf)) + continue; + memcpy(&ifrbuf.ifr_name, ifr->ifr_name, sizeof(ifrbuf.ifr_name)); + if (count++) + break; + } } - for (p = ba, ch = 0; p < ba + balen; p++, ch += 3) - *p = strtoul(brdcast->value + ch, NULL, 16); + close(s); + + if (count == 1) { + device.ifindex = ifrbuf.ifr_ifindex; + device.name = ifrbuf.ifr_name; + } + return !device.ifindex; +out: + close(s); + return -1; +} + +static int find_device(void) +{ + int rc; + rc = find_device_by_ifaddrs(); + if (rc >= 0) + goto out; + rc = find_device_by_sysfs(); + if (rc >= 0) + goto out; + rc = find_device_by_ioctl(); +out: + return rc; +} + +/* + * set_device_broadcast() + * + * This fills the device "broadcast address" + * based on information found by find_device() funcion. + */ +static int set_device_broadcast_ifaddrs_one(struct device *device, unsigned char *ba, size_t balen, int fatal) +{ +#ifndef WITHOUT_IFADDRS + struct ifaddrs *ifa; + struct sockaddr_ll *sll; + + if (!device) + return -1; + + ifa = device->ifa; + if (!ifa) + return -1; + + sll = (struct sockaddr_ll *)ifa->ifa_broadaddr; - return; + if (sll->sll_halen != balen) { + if (fatal) { + if (!quiet) + printf("Address length does not match...\n"); + exit(2); + } + return -1; + } + memcpy(ba, sll->sll_addr, sll->sll_halen); + return 0; +#else + return -1; +#endif +} +int set_device_broadcast_sysfs(struct device *device, unsigned char *ba, size_t balen) +{ +#ifdef USE_SYSFS + struct sysfs_devattr_values *v; + if (!device) + return -1; + v = device->sysfs; + if (!v) + return -1; + if (v->value[SYSFS_DEVATTR_ADDR_LEN].ulong != balen) + return -1; + memcpy(ba, v->value[SYSFS_DEVATTR_BROADCAST].ptr, balen); + return 0; +#else + return -1; +#endif +} + +static int set_device_broadcast_fallback(struct device *device, unsigned char *ba, size_t balen) +{ + if (!quiet) + fprintf(stderr, "WARNING: using default broadcast address.\n"); + memset(ba, -1, balen); + return 0; +} + +static void set_device_broadcast(struct device *dev, unsigned char *ba, size_t balen) +{ + if (!set_device_broadcast_ifaddrs_one(dev, ba, balen, 0)) + return; + if (!set_device_broadcast_sysfs(dev, ba, balen)) + return; + set_device_broadcast_fallback(dev, ba, balen); } int @@ -346,15 +998,19 @@ { int socket_errno; int ch; - uid_t uid = getuid(); + + limit_capabilities(); + +#ifdef USE_IDN + setlocale(LC_ALL, ""); +#endif + + enable_capability_raw(); s = socket(PF_PACKET, SOCK_DGRAM, 0); socket_errno = errno; - if (setuid(uid)) { - perror("arping: setuid"); - exit(-1); - } + disable_capability_raw(); while ((ch = getopt(argc, argv, "h?bfDUAqc:w:s:I:V")) != EOF) { switch(ch) { @@ -382,7 +1038,7 @@ timeout = atoi(optarg); break; case 'I': - device = optarg; + device.name = optarg; break; case 'f': quit_on_reply=1; @@ -391,7 +1047,7 @@ source = optarg; break; case 'V': - printf("arping utility, iputils-ss%s\n", SNAPSHOT); + printf("arping utility, iputils-%s\n", SNAPSHOT); exit(0); case 'h': case '?': @@ -407,10 +1063,8 @@ target = *argv; - if (device == NULL) { - fprintf(stderr, "arping: device (option -I) is required\n"); - usage(); - } + if (device.name && !*device.name) + device.name = NULL; if (s < 0) { errno = socket_errno; @@ -418,39 +1072,42 @@ exit(2); } - if (1) { - struct ifreq ifr; - memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, device, IFNAMSIZ-1); - if (ioctl(s, SIOCGIFINDEX, &ifr) < 0) { - fprintf(stderr, "arping: unknown iface %s\n", device); - exit(2); - } - ifindex = ifr.ifr_ifindex; + if (find_device() < 0) + exit(2); - if (ioctl(s, SIOCGIFFLAGS, (char*)&ifr)) { - perror("ioctl(SIOCGIFFLAGS)"); + if (!device.ifindex) { + if (device.name) { + fprintf(stderr, "arping: Device %s not available.\n", device.name); exit(2); } - if (!(ifr.ifr_flags&IFF_UP)) { - if (!quiet) - printf("Interface \"%s\" is down\n", device); - exit(2); - } - if (ifr.ifr_flags&(IFF_NOARP|IFF_LOOPBACK)) { - if (!quiet) - printf("Interface \"%s\" is not ARPable\n", device); - exit(dad?0:2); - } + fprintf(stderr, "arping: device (option -I) is required.\n"); + usage(); } if (inet_aton(target, &dst) != 1) { struct hostent *hp; - hp = gethostbyname2(target, AF_INET); + char *idn = target; +#ifdef USE_IDN + int rc; + + rc = idna_to_ascii_lz(target, &idn, 0); + + if (rc != IDNA_SUCCESS) { + fprintf(stderr, "arping: IDN encoding failed: %s\n", idna_strerror(rc)); + exit(2); + } +#endif + + hp = gethostbyname2(idn, AF_INET); if (!hp) { fprintf(stderr, "arping: unknown host %s\n", target); exit(2); } + +#ifdef USE_IDN + free(idn); +#endif + memcpy(&dst, hp->h_addr, 4); } @@ -470,9 +1127,13 @@ perror("socket"); exit(2); } - if (device) { - if (setsockopt(probe_fd, SOL_SOCKET, SO_BINDTODEVICE, device, strlen(device)+1) == -1) + if (device.name) { + enable_capability_raw(); + + if (setsockopt(probe_fd, SOL_SOCKET, SO_BINDTODEVICE, device.name, strlen(device.name)+1) == -1) perror("WARNING: interface is ignored"); + + disable_capability_raw(); } memset(&saddr, 0, sizeof(saddr)); saddr.sin_family = AF_INET; @@ -505,7 +1166,7 @@ }; ((struct sockaddr_ll *)&me)->sll_family = AF_PACKET; - ((struct sockaddr_ll *)&me)->sll_ifindex = ifindex; + ((struct sockaddr_ll *)&me)->sll_ifindex = device.ifindex; ((struct sockaddr_ll *)&me)->sll_protocol = htons(ETH_P_ARP); if (bind(s, (struct sockaddr*)&me, sizeof(me)) == -1) { perror("bind"); @@ -521,22 +1182,18 @@ } if (((struct sockaddr_ll *)&me)->sll_halen == 0) { if (!quiet) - printf("Interface \"%s\" is not ARPable (no ll address)\n", device); + printf("Interface \"%s\" is not ARPable (no ll address)\n", device.name); exit(dad?0:2); } he = me; -#if 1 - set_device_broadcast(device, ((struct sockaddr_ll *)&he)->sll_addr, + set_device_broadcast(&device, ((struct sockaddr_ll *)&he)->sll_addr, ((struct sockaddr_ll *)&he)->sll_halen); -#else - memset(((struct sockaddr_ll *)&he)->sll_addr, -1, ((struct sockaddr_ll *)&he)->sll_halen); -#endif if (!quiet) { printf("ARPING %s ", inet_ntoa(dst)); - printf("from %s %s\n", inet_ntoa(src), device ? : ""); + printf("from %s %s\n", inet_ntoa(src), device.name ? : ""); } if (!src.s_addr && !dad) { @@ -544,6 +1201,8 @@ exit(2); } + drop_capabilities(); + set_signal(SIGINT, finish); set_signal(SIGALRM, catcher); diff -Nru iputils-20101006/clockdiff.c iputils-20121221/clockdiff.c --- iputils-20101006/clockdiff.c 2011-01-24 08:10:05.000000000 +0000 +++ iputils-20121221/clockdiff.c 2012-12-21 14:01:07.000000000 +0000 @@ -20,6 +20,9 @@ #include #include #include +#ifdef CAPABILITIES +#include +#endif void usage(void) __attribute__((noreturn)); @@ -95,7 +98,7 @@ int interactive = 0; -int id; +uint16_t id; int sock; int sock_raw; struct sockaddr_in server; @@ -126,7 +129,7 @@ int msgcount; int cc, count; fd_set ready; - long sendtime, recvtime, histime, histime1; + long sendtime, recvtime, histime; long min1, min2, diff; long delta1, delta2; struct timeval tv1, tout; @@ -240,7 +243,6 @@ rtt_sigma = (rtt_sigma *3 + abs(diff-rtt))/4; msgcount++; histime = ntohl(((__u32*)(icp+1))[1]); - histime1 = ntohl(((__u32*)(icp+1))[2]); /* * a hosts using a time format different from * ms. since midnight UT (as per RFC792) should @@ -530,6 +532,20 @@ exit(1); } +void drop_rights(void) { +#ifdef CAPABILITIES + cap_t caps = cap_init(); + if (cap_set_proc(caps)) { + perror("clockdiff: cap_set_proc"); + exit(-1); + } + cap_free(caps); +#endif + if (setuid(getuid())) { + perror("clockdiff: setuid"); + exit(-1); + } +} int main(int argc, char *argv[]) @@ -538,22 +554,20 @@ struct hostent * hp; char hostname[MAX_HOSTNAMELEN]; int s_errno = 0; + int n_errno = 0; if (argc < 2) { - if (setuid(getuid())) { - perror("clockdiff: setuid"); - exit(-1); - } + drop_rights(); usage(); } sock_raw = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); s_errno = errno; - if (setuid(getuid())) { - perror("clockdiff: setuid"); - exit(-1); - } + errno = 0; + if (nice(-16) == -1) + n_errno = errno; + drop_rights(); if (argc == 3) { if (strcmp(argv[1], "-o") == 0) { @@ -573,6 +587,12 @@ exit(1); } + if (n_errno < 0) { + errno = n_errno; + perror("clockdiff: nice"); + exit(1); + } + if (isatty(fileno(stdin)) && isatty(fileno(stdout))) interactive = 1; @@ -629,8 +649,6 @@ } } - nice(-16); - if ((measure_status = (ip_opt_len ? measure_opt : measure)(&server)) < 0) { if (errno) perror("measure"); diff -Nru iputils-20101006/debian/changelog iputils-20121221/debian/changelog --- iputils-20101006/debian/changelog 2012-10-02 16:01:47.000000000 +0000 +++ iputils-20121221/debian/changelog 2013-05-16 14:39:49.000000000 +0000 @@ -1,3 +1,22 @@ +iputils (3:20121221-1ubuntu1) saucy; urgency=low + + * Resynchronise with Debian. Remaining changes: + - Support cross-building. + + -- Colin Watson Thu, 16 May 2013 15:39:45 +0100 + +iputils (3:20121221-1) unstable; urgency=low + + * New upstream version + * Replace libsysfs-dev with libcap-dev in build-deps (Closes: 627650, 609853) + * Replace libssl-dev with gnutls-dev in build-deps + * Remove obsolete debian/patches/fix-dead-host-ping-stats.diff + * Remove obsolete debian/patches/add-icmp-return-codes.diff + * Remove obsolete patch cleanup-docbook-formatting.diff + * Remove obsolete patch fix_rfc4620_nodeinfo_queries + + -- Noah Meyerhans Tue, 14 May 2013 23:59:05 -0700 + iputils (3:20101006-3ubuntu1) quantal; urgency=low * Resynchronise with Debian. Remaining changes: diff -Nru iputils-20101006/debian/control iputils-20121221/debian/control --- iputils-20101006/debian/control 2012-10-02 16:00:01.000000000 +0000 +++ iputils-20121221/debian/control 2013-05-16 14:38:56.000000000 +0000 @@ -4,7 +4,7 @@ Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Noah Meyerhans Standards-Version: 3.9.3.1 -Build-Depends: debhelper (>= 7), sp, sgmlspl, docbook, libsysfs-dev, libssl-dev +Build-Depends: debhelper (>= 7), sp, sgmlspl, docbook, libcap-dev, libgnutls-dev Vcs-Git: git://git.debian.org/collab-maint/iputils.git Vcs-Browser: http://git.debian.org/?p=collab-maint/iputils.git;a=summary diff -Nru iputils-20101006/debian/patches/add-icmp-return-codes.diff iputils-20121221/debian/patches/add-icmp-return-codes.diff --- iputils-20101006/debian/patches/add-icmp-return-codes.diff 2012-08-29 17:18:31.000000000 +0000 +++ iputils-20121221/debian/patches/add-icmp-return-codes.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -Index: trunk/ping.c -=================================================================== ---- trunk.orig/ping.c 2010-05-07 23:13:54.000000000 -0700 -+++ trunk/ping.c 2010-05-07 23:23:22.000000000 -0700 -@@ -883,9 +883,36 @@ - case ICMP_SR_FAILED: - printf("Source Route Failed\n"); - break; -+ case ICMP_NET_UNKNOWN: -+ printf("Destination Net Unknown\n"); -+ break; -+ case ICMP_HOST_UNKNOWN: -+ printf("Destination Host Unknown\n"); -+ break; -+ case ICMP_HOST_ISOLATED: -+ printf("Source Host Isolated\n"); -+ break; -+ case ICMP_NET_ANO: -+ printf("Destination Net Prohibited\n"); -+ break; -+ case ICMP_HOST_ANO: -+ printf("Destination Host Prohibited\n"); -+ break; -+ case ICMP_NET_UNR_TOS: -+ printf("Destination Net Unreachable for Type of Service\n"); -+ break; -+ case ICMP_HOST_UNR_TOS: -+ printf("Destination Host Unreachable for Type of Service\n"); -+ break; - case ICMP_PKT_FILTERED: - printf("Packet filtered\n"); - break; -+ case ICMP_PREC_VIOLATION: -+ printf("Precedence Violation\n"); -+ break; -+ case ICMP_PREC_CUTOFF: -+ printf("Precedence Cutoff\n"); -+ break; - default: - printf("Dest Unreachable, Bad Code: %d\n", code); - break; diff -Nru iputils-20101006/debian/patches/bug_601147_audible_flood iputils-20121221/debian/patches/bug_601147_audible_flood --- iputils-20101006/debian/patches/bug_601147_audible_flood 2012-08-29 17:18:31.000000000 +0000 +++ iputils-20121221/debian/patches/bug_601147_audible_flood 2013-05-15 07:07:26.000000000 +0000 @@ -1,8 +1,8 @@ Index: iputils/ping.c =================================================================== ---- iputils.orig/ping.c 2012-08-19 21:37:16.000000000 -0700 -+++ iputils/ping.c 2012-08-19 21:48:30.000000000 -0700 -@@ -806,16 +806,16 @@ +--- iputils.orig/ping.c 2013-05-14 09:19:40.720771172 -0700 ++++ iputils/ping.c 2013-05-14 09:30:55.344116453 -0700 +@@ -876,16 +876,16 @@ return 0; } @@ -26,9 +26,9 @@ } Index: iputils/ping6.c =================================================================== ---- iputils.orig/ping6.c 2012-08-19 21:37:16.000000000 -0700 -+++ iputils/ping6.c 2012-08-19 21:50:09.000000000 -0700 -@@ -1411,14 +1411,14 @@ +--- iputils.orig/ping6.c 2013-05-14 09:19:37.000000000 -0700 ++++ iputils/ping6.c 2013-05-14 09:30:55.344116453 -0700 +@@ -1667,14 +1667,14 @@ pr_icmph(icmph->icmp6_type, icmph->icmp6_code, ntohl(icmph->icmp6_mtu)); } diff -Nru iputils-20101006/debian/patches/bug_628893_flush_stdout_on_truncated_packets iputils-20121221/debian/patches/bug_628893_flush_stdout_on_truncated_packets --- iputils-20101006/debian/patches/bug_628893_flush_stdout_on_truncated_packets 2012-08-29 17:18:31.000000000 +0000 +++ iputils-20121221/debian/patches/bug_628893_flush_stdout_on_truncated_packets 2013-05-15 07:07:26.000000000 +0000 @@ -1,8 +1,8 @@ Index: iputils/ping.c =================================================================== ---- iputils.orig/ping.c 2012-08-19 21:50:43.000000000 -0700 -+++ iputils/ping.c 2012-08-19 21:59:42.000000000 -0700 -@@ -717,8 +717,10 @@ +--- iputils.orig/ping.c 2013-05-14 09:30:55.344116453 -0700 ++++ iputils/ping.c 2013-05-14 09:31:55.276413640 -0700 +@@ -787,8 +787,10 @@ if (gather_statistics((__u8*)icp, sizeof(*icp), cc, ntohs(icp->un.echo.sequence), ip->ttl, 0, tv, pr_addr(from->sin_addr.s_addr), @@ -16,9 +16,9 @@ * Also this branch processes icmp errors, when IP_RECVERR Index: iputils/ping6.c =================================================================== ---- iputils.orig/ping6.c 2012-08-19 21:50:43.000000000 -0700 -+++ iputils/ping6.c 2012-08-19 22:00:42.000000000 -0700 -@@ -1351,8 +1351,10 @@ +--- iputils.orig/ping6.c 2013-05-14 09:30:55.344116453 -0700 ++++ iputils/ping6.c 2013-05-14 09:31:55.276413640 -0700 +@@ -1607,8 +1607,10 @@ if (gather_statistics((__u8*)icmph, sizeof(*icmph), cc, ntohs(icmph->icmp6_seq), hops, 0, tv, pr_addr(&from->sin6_addr), @@ -29,4 +29,4 @@ + } } else if (icmph->icmp6_type == ICMPV6_NI_REPLY) { struct ni_hdr *nih = (struct ni_hdr *)icmph; - __u16 seq = ntohs(*(__u16 *)nih->ni_nonce); + int seq = niquery_check_nonce(nih->ni_nonce); diff -Nru iputils-20101006/debian/patches/cleanup-docbook-formatting.diff iputils-20121221/debian/patches/cleanup-docbook-formatting.diff --- iputils-20101006/debian/patches/cleanup-docbook-formatting.diff 2012-08-29 17:18:31.000000000 +0000 +++ iputils-20121221/debian/patches/cleanup-docbook-formatting.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ ---- iputils-upstream/doc/docbook2man-spec.pl 2007-10-28 12:24:10.000000000 -0400 -+++ iputils/doc/docbook2man-spec.pl 2007-10-28 12:19:17.000000000 -0400 -@@ -428,7 +428,7 @@ - output ' '; - - if($_[0]->attribute('CHOICE')->value =~ /opt/i) { -- output '[ '; -+ output '['; - } - bold_on(); - } -@@ -441,7 +441,7 @@ - font_off(); - } - if($_[0]->attribute('CHOICE')->value =~ /opt/i) { -- output '] '; -+ output ']'; - } - } - diff -Nru iputils-20101006/debian/patches/fix-arping-timeouts.diff iputils-20121221/debian/patches/fix-arping-timeouts.diff --- iputils-20101006/debian/patches/fix-arping-timeouts.diff 2012-08-29 17:18:31.000000000 +0000 +++ iputils-20121221/debian/patches/fix-arping-timeouts.diff 2013-05-15 07:07:26.000000000 +0000 @@ -1,24 +1,28 @@ -Index: trunk/arping.c +See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=233125 +Index: iputils/arping.c =================================================================== ---- trunk.orig/arping.c 2010-05-07 23:13:52.000000000 -0700 -+++ trunk/arping.c 2010-05-07 23:41:16.000000000 -0700 -@@ -182,12 +182,17 @@ - if (start.tv_sec==0) - start = tv; +--- iputils.orig/arping.c 2013-05-14 09:19:37.000000000 -0700 ++++ iputils/arping.c 2013-05-14 09:26:54.314921159 -0700 +@@ -348,15 +348,20 @@ + tv_o.tv_sec = timeout; + tv_o.tv_usec = 500 * 1000; -- if (count-- == 0 || (timeout && MS_TDIFF(tv,start) > timeout*1000 + 500)) -+ if (timeout && MS_TDIFF(tv,start) > timeout*1000 + 500) - finish(); - -- if (last.tv_sec==0 || MS_TDIFF(tv,last) > 500) { -+ if ((!timeout) && (count == 0)) +- if (count-- == 0 || (timeout && timercmp(&tv_s, &tv_o, >))) ++ if (timeout && timercmp(&tv_s, &tv_o, >)) + finish(); + -+ if ( count!=0 && (last.tv_sec==0 || MS_TDIFF(tv,last) > 500 ) ) { ++ if ((!timeout) && (count == 0)) + finish(); + + timersub(&tv, &last, &tv_s); + tv_o.tv_sec = 0; + +- if (last.tv_sec==0 || timercmp(&tv_s, &tv_o, >)) { ++ if (count!=0 && (last.tv_sec==0 || timercmp(&tv_s, &tv_o, >))) { send_pack(s, src, dst, (struct sockaddr_ll *)&me, (struct sockaddr_ll *)&he); -+ if (count >= 0) -+ count--; ++ if(count >= 0) ++ count--; if (count == 0 && unsolicited) finish(); } diff -Nru iputils-20101006/debian/patches/fix-dead-host-ping-stats.diff iputils-20121221/debian/patches/fix-dead-host-ping-stats.diff --- iputils-20101006/debian/patches/fix-dead-host-ping-stats.diff 2012-08-29 17:18:31.000000000 +0000 +++ iputils-20121221/debian/patches/fix-dead-host-ping-stats.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -Index: trunk/ping_common.c -=================================================================== ---- trunk.orig/ping_common.c 2010-05-07 23:13:51.000000000 -0700 -+++ trunk/ping_common.c 2010-05-07 23:22:33.000000000 -0700 -@@ -872,7 +872,8 @@ - printf("%spipe %d", comma, pipesize); - comma = ", "; - } -- if (ntransmitted > 1 && (!interval || (options&(F_FLOOD|F_ADAPTIVE)))) { -+ if (ntransmitted > 1 && nreceived && -+ (!interval || (options&(F_FLOOD|F_ADAPTIVE)))) { - int ipg = (1000000*(long long)tv.tv_sec+tv.tv_usec)/(ntransmitted-1); - printf("%sipg/ewma %d.%03d/%d.%03d ms", - comma, ipg/1000, ipg%1000, rtt/8000, (rtt/8)%1000); diff -Nru iputils-20101006/debian/patches/fix_rfc4620_nodeinfo_queries iputils-20121221/debian/patches/fix_rfc4620_nodeinfo_queries --- iputils-20101006/debian/patches/fix_rfc4620_nodeinfo_queries 2012-08-29 17:18:31.000000000 +0000 +++ iputils-20121221/debian/patches/fix_rfc4620_nodeinfo_queries 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -Index: iputils/ping6.c -=================================================================== ---- iputils.orig/ping6.c 2012-08-19 21:16:39.000000000 -0700 -+++ iputils/ping6.c 2012-08-19 21:21:45.000000000 -0700 -@@ -357,7 +357,7 @@ - hints.ai_socktype = SOCK_DGRAM; - - gai = getaddrinfo(arg, 0, &hints, &ai0); -- if (!gai) { -+ if (gai) { - fprintf(stderr, "Unknown host: %s\n", arg); - return -1; - } diff -Nru iputils-20101006/debian/patches/series iputils-20121221/debian/patches/series --- iputils-20101006/debian/patches/series 2012-10-02 16:01:13.000000000 +0000 +++ iputils-20121221/debian/patches/series 2013-05-15 07:07:26.000000000 +0000 @@ -1,11 +1,7 @@ -fix-dead-host-ping-stats.diff -add-icmp-return-codes.diff use_gethostbyname2.diff -cleanup-docbook-formatting.diff targets.diff fix-tracepath-docs.diff fix-arping-timeouts.diff -fix_rfc4620_nodeinfo_queries bug_601147_audible_flood bug_628893_flush_stdout_on_truncated_packets set_buildflags diff -Nru iputils-20101006/debian/patches/set_buildflags iputils-20121221/debian/patches/set_buildflags --- iputils-20101006/debian/patches/set_buildflags 2012-08-29 17:18:31.000000000 +0000 +++ iputils-20121221/debian/patches/set_buildflags 2013-05-15 07:07:26.000000000 +0000 @@ -1,31 +1,44 @@ Index: iputils/Makefile =================================================================== ---- iputils.orig/Makefile 2012-08-29 09:06:16.000000000 -0700 -+++ iputils/Makefile 2012-08-29 09:08:33.000000000 -0700 -@@ -13,8 +13,8 @@ - CC=gcc +--- iputils.orig/Makefile 2013-05-14 23:50:41.032029459 -0700 ++++ iputils/Makefile 2013-05-14 23:51:34.188293041 -0700 +@@ -49,10 +49,11 @@ + # ------------------------------------- # What a pity, all new gccs are buggy and -Werror does not work. Sigh. - #CCOPT=-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g -Werror --CCOPT=-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g --CFLAGS=$(CCOPT) $(GLIBCFIX) $(DEFINES) -+CCOPT=-D_GNU_SOURCE -Wstrict-prototypes -Wall + # CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -Werror -g +-CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -g ++CCOPT=-Wstrict-prototypes -Wall + CCOPTOPT=-O3 + GLIBCFIX=-D_GNU_SOURCE + DEFINES= +CFLAGS=$(DEBIAN_CFLAGS) $(CCOPT) $(GLIBCFIX) $(DEFINES) + LDLIB= - IPV4_TARGETS=tracepath ping arping clockdiff + FUNC_LIB = $(if $(filter static,$(1)),$(LDFLAG_STATIC) $(2) $(LDFLAG_DYNAMIC),$(2)) +@@ -110,7 +111,7 @@ IPV6_TARGETS=tracepath6 traceroute6 ping6 -@@ -27,9 +27,13 @@ + TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS) +-CFLAGS=$(CCOPTOPT) $(CCOPT) $(GLIBCFIX) $(DEFINES) ++CFLAGS=$(DEBIAN_CFLAGS) $(CCOPTOPT) $(CCOPT) $(GLIBCFIX) $(DEFINES) + LDLIBS=$(LDLIB) $(ADDLIB) - tftpd: tftpd.o tftpsubs.o --arping: arping.o -lsysfs -+ $(CC) $(LDFLAGS) tftpd.o tftpsubs.o -o tftpd -+arping: arping.o -+ $(CC) $(LDFLAGS) arping.o -o arping -lsysfs - ping: ping.o ping_common.o --ping6: ping6.o ping_common.o -lresolv -lcrypto -+ $(CC) $(LDFLAGS) ping.o ping_common.o -o ping -+ping6: ping6.o ping_common.o -+ $(CC) $(LDFLAGS) ping6.o ping_common.o -lresolv -lcrypto -o ping6 - ping.o ping6.o ping_common.o: ping_common.h - tftpd.o tftpsubs.o: tftp.h + UNAME_N:=$(shell uname -n) +@@ -130,7 +131,7 @@ + %.o: %.c + $(COMPILE.c) $< $(DEF_$(patsubst %.o,%,$@)) -o $@ + $(TARGETS): %: %.o +- $(LINK.o) $^ $(LIB_$@) $(LDLIBS) -o $@ ++ $(LINK.o) $^ $(DEBIAN_LDFLAGS) $(LIB_$@) $(LDLIBS) -o $@ + # ------------------------------------- + # arping +@@ -149,7 +150,7 @@ + DEF_ping_common = $(DEF_CAP) $(DEF_IDN) + DEF_ping = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) + LIB_ping = $(LIB_CAP) $(LIB_IDN) +-DEF_ping6 = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) $(DEF_ENABLE_PING6_RTHDR) ++DEF_ping6 = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) $(DEF_ENABLE_PING6_RTHDR) $(DEF_CRYPTO) + LIB_ping6 = $(LIB_CAP) $(LIB_IDN) $(LIB_RESOLV) $(LIB_CRYPTO) + + ping: ping_common.o diff -Nru iputils-20101006/debian/patches/targets.diff iputils-20121221/debian/patches/targets.diff --- iputils-20101006/debian/patches/targets.diff 2012-08-29 17:18:31.000000000 +0000 +++ iputils-20121221/debian/patches/targets.diff 2013-05-15 07:07:26.000000000 +0000 @@ -1,13 +1,13 @@ -Index: trunk/Makefile +Index: iputils/Makefile =================================================================== ---- trunk.orig/Makefile 2010-05-07 23:43:00.000000000 -0700 -+++ trunk/Makefile 2010-05-07 23:47:10.000000000 -0700 -@@ -16,7 +16,7 @@ - CCOPT=-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g - CFLAGS=$(CCOPT) $(GLIBCFIX) $(DEFINES) +--- iputils.orig/Makefile 2013-05-14 08:57:05.000000000 -0700 ++++ iputils/Makefile 2013-05-14 09:11:54.686460217 -0700 +@@ -106,7 +106,7 @@ + endif + # ------------------------------------- -IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd -+IPV4_TARGETS=tracepath ping arping clockdiff ++IPV4_TARGETS=tracepath ping clockdiff arping IPV6_TARGETS=tracepath6 traceroute6 ping6 TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS) diff -Nru iputils-20101006/debian/patches/use_gethostbyname2.diff iputils-20121221/debian/patches/use_gethostbyname2.diff --- iputils-20101006/debian/patches/use_gethostbyname2.diff 2012-08-29 17:18:31.000000000 +0000 +++ iputils-20121221/debian/patches/use_gethostbyname2.diff 2013-05-15 07:07:26.000000000 +0000 @@ -1,29 +1,30 @@ -Index: trunk/tracepath.c +See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=305062 +Index: iputils/ping.c =================================================================== ---- trunk.orig/tracepath.c 2010-05-07 23:13:52.000000000 -0700 -+++ trunk/tracepath.c 2010-05-07 23:24:09.000000000 -0700 -@@ -338,9 +338,9 @@ - base_port = atoi(p+1); - } else - base_port = 44444; -- he = gethostbyname(argv[0]); -+ he = gethostbyname2(argv[0], AF_INET); +--- iputils.orig/ping.c 2013-05-14 09:03:28.327949337 -0700 ++++ iputils/ping.c 2013-05-14 09:05:38.508594892 -0700 +@@ -279,7 +279,7 @@ + #else + idn = target; + #endif +- hp = gethostbyname(idn); ++ hp = gethostbyname2(idn, AF_INET); + if (!hp) { + fprintf(stderr, "ping: unknown host %s\n", target); + exit(2); +Index: iputils/tracepath.c +=================================================================== +--- iputils.orig/tracepath.c 2013-05-14 09:03:28.327949337 -0700 ++++ iputils/tracepath.c 2013-05-14 09:06:00.100701918 -0700 +@@ -370,9 +370,9 @@ + } + #endif + +- he = gethostbyname(p); ++ he = gethostbyname2(p, AF_INET); if (he == NULL) { - herror("gethostbyname"); + herror("gethostbyname2"); exit(1); } - memcpy(&target.sin_addr, he->h_addr, 4); -Index: trunk/ping.c -=================================================================== ---- trunk.orig/ping.c 2010-05-07 23:23:22.000000000 -0700 -+++ trunk/ping.c 2010-05-07 23:24:09.000000000 -0700 -@@ -250,7 +250,7 @@ - if (argc == 1) - options |= F_NUMERIC; - } else { -- hp = gethostbyname(target); -+ hp = gethostbyname2(target, AF_INET); - if (!hp) { - fprintf(stderr, "ping: unknown host %s\n", target); - exit(2); + diff -Nru iputils-20101006/doc/arping.sgml iputils-20121221/doc/arping.sgml --- iputils-20101006/doc/arping.sgml 2011-01-24 08:10:05.000000000 +0000 +++ iputils-20121221/doc/arping.sgml 2012-12-21 14:01:07.000000000 +0000 @@ -67,7 +67,7 @@