netsniff-ng: also capture if NIC is currently down
authorDaniel Borkmann <dborkman@redhat.com>
Sat, 6 Apr 2013 08:18:41 +0000 (6 10:18 +0200)
committerDaniel Borkmann <dborkman@redhat.com>
Sat, 6 Apr 2013 08:18:41 +0000 (6 10:18 +0200)
There is actually no reason why netsniff-ng should fail if the NIC is
down at startup. We still can setup everything and already capture at
the time it goes up. This might be useful when replugging cables on
servers, for instance.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
netsniff-ng.c

index ecb9e9a..eaf2416 100644 (file)
@@ -347,8 +347,6 @@ static void receive_to_xmit(struct ctx *ctx)
                panic("Ingress/egress devices must be different!\n");
        if (!device_up_and_running(ctx->device_out))
                panic("Egress device not up and running!\n");
-       if (!device_up_and_running(ctx->device_in))
-               panic("Ingress device not up and running!\n");
 
        rx_sock = pf_socket();
        tx_sock = pf_socket();
@@ -820,9 +818,6 @@ static void recv_only_or_dump(struct ctx *ctx)
        struct timeval start, end, diff;
        pcap_pkthdr_t phdr;
 
-       if (!device_up_and_running(ctx->device_in) && !ctx->rfraw)
-               panic("Device not up and running!\n");
-
        sock = pf_socket();
 
        if (ctx->rfraw) {