]>
Commit | Line | Data |
---|---|---|
826b0c9d ER |
1 | Summary: Set the value reported for a network card MAC address |
2 | Name: fakeif | |
3 | Version: 0.1 | |
4 | Release: 0.1 | |
5 | License: ? | |
6 | Group: Applications | |
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) | |
11 | ||
12 | %description | |
13 | Set the value reported for a network card MAC address. | |
14 | ||
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 | |
19 | variable. | |
20 | ||
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 | |
24 | ||
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. | |
27 | ||
28 | %prep | |
29 | %setup -q | |
30 | ||
31 | %build | |
32 | %{__cc} %{rpmcflags} %{rpmcppflags} -s -shared -o libfakeif.so %{rpmldflags} fakeif.c | |
33 | ||
34 | %install | |
35 | rm -rf $RPM_BUILD_ROOT | |
36 | install -d $RPM_BUILD_ROOT%{_libdir} | |
37 | install -p libfakeif.so $RPM_BUILD_ROOT%{_libdir} | |
38 | ||
39 | %clean | |
40 | rm -rf $RPM_BUILD_ROOT | |
41 | ||
42 | %files | |
43 | %defattr(644,root,root,755) | |
44 | %attr(755,root,root) %{_libdir}/libfakeif.so |