mulix wrote:
Gilad Ben-Yossef wrote:
ifstat source snipped
strcpy(ifr.ifr_name, argv[1]);
this is broken. ifr.ifr_name is a char array of size IFNAMSIZ (which is
defined to 16 in net/if.h- not a very long buffer). if the user supplies
a long enough argv[1], you have your
Hi people
I have this question:
How can I determine if a network interface is up in C/C++ only?
I need something that will give something like what ifconfig does in
C/C++.
Thanks in advance
Isaac Aaron
=
To unsubscribe, send
Isaac Aaron wrote:
How can I determine if a network interface is up in C/C++ only?
in short, you use various ioctl calls to get the list of interfaces from
the kernel and to get the flags for a specific interface, or you can
parse /proc/net/dev and see if the interface you need appears there.
Isaac Aaron wrote:
I have this question:
How can I determine if a network interface is up in C/C++ only?
Share Enjoy:
/*
ifstat - a small stupid utility to test net interfaces status
Copyright (C) 2000 Gilad Ben-Yossef
This program is free software; you can redistribute it
Gilad Ben-Yossef writes:
"Anything that can go wrong, will go wrong, while interrupts are disabled. "
-- Murphey's law of kernel programing.
Can not agree more :) (It will, I checked that :)
=
To unsubscribe, send
Gilad Ben-Yossef wrote:
ifstat source snipped
strcpy(ifr.ifr_name, argv[1]);
this is broken. ifr.ifr_name is a char array of size IFNAMSIZ (which is
defined to 16 in net/if.h- not a very long buffer). if the user supplies
a long enough argv[1], you have your classic buffer overflow here,
On Fri, 15 Dec 2000, mulix wrote:
strcpy(ifr.ifr_name, argv[1]);
this is broken. ifr.ifr_name is a char array of size IFNAMSIZ (which is
defined to 16 in net/if.h- not a very long buffer). if the user supplies
a long enough argv[1], you have your classic buffer overflow here,
easily