bind() returning -1 (for a tftp server)

I am trying to write a TFTP server. I have successfully completed the code, it is fully RFC 1350 compliant.
However, I wrote the whole thing in Haiku OS, and in Haiku, it works great. However, I also need a DHCP server, and I don't have one for Haiku. So I need to port my TFTP server to Linux.
Now the code compiles fine in linux, but does not receive any packets sent to it. I can do wireshark captures and see that the packets are arriving, but my server does not receive them. I added some debugging printfs and found that bind is returning a -1 (instead of 0 like in Haiku). I am running the executable as root, so its not a permissions issue. Am I doing something wrong? Here is some of my code:

Some more error checking wouldn't go amiss either. You might have found the error to be "EPERM" or something.

I am running the executable as root, so its not a permissions issue.

Yes, I am running as root. sudo ./tftps I'm thinking maybe something else is using that port, but I uninstalled all other tftp severs, and I see no other traffic on wireshark.
Meanwhile, i'll add some more error checking. I have a tendency to use printf for all debugging.

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...