1 Summary: Set the value reported for a network card MAC address
7 Source0: http://www.chiark.greenend.org.uk/~peterb/linux/fakeif/%{name}-%{version}.tar.bz2
8 # Source0-md5: 1ff69e4d383a9473ce94c50b16701001
9 URL: http://www.chiark.greenend.org.uk/~peterb/linux/fakeif/
10 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
13 Set the value reported for a network card MAC address.
15 This program demonstrates the use of LD_PRELOAD to override the value
16 returned by the library call. The library call in question is ioctl.
17 When called with cmd set to SIOCGIFHWADDR, we override the value
18 returned by the system call with the value from an environment
21 To use the program, first set the environment variable
22 HWADDR_interface to the MAC address you would like to be returned. For
23 example, to set eth0 to 11:22:33:44:55:66, do
25 HWADDR_eth0=11:22:33:44:55:66 export HWADDR_eth0 Then set LD_PRELOAD
26 to the absolute path of fakeif.so and call your test program.
32 %{__cc} %{rpmcflags} %{rpmcppflags} -s -shared -o libfakeif.so %{rpmldflags} fakeif.c
35 rm -rf $RPM_BUILD_ROOT
36 install -d $RPM_BUILD_ROOT%{_libdir}
37 install -p libfakeif.so $RPM_BUILD_ROOT%{_libdir}
40 rm -rf $RPM_BUILD_ROOT
43 %defattr(644,root,root,755)
44 %attr(755,root,root) %{_libdir}/libfakeif.so