Right to peaceful passage can be nullified
IF there is an intention to violate someone else's territory. Or in the case of Somali piracy, there is a clear intention of committing a crime.
BBC News - Nato warship destroys pirate boats in Somali Basin
UNCLOS -Right To Innocent Passage
"... ships of all States, whether coastal or land-locked, enjoy the right of innocent passage through the territorial sea.
"Passage is innocent so long as it is not prejudicial to the peace, good order or security of the coastal State. Such passage shall take place in conformity with this Convention and with other rules of international law.
"Passage of a foreign ship shall be considered to be prejudicial to the peace, good order or security of the coastal State if in the territorial sea it engages in any of the following activities:
any threat or use of force against the sovereignty, territorial integrity or political independence of the coastal State, or in any other manner in violation of the principles of international law embodied in the Charter of the United Nations;
any exercise or practice with weapons of any kind;
any act aimed at collecting information to the prejudice of the defence or security of the coastal State;
any act of propaganda aimed at affecting the defence or security of the coastal State;
the launching, landing or taking on board of any aircraft;
the launching, landing or taking on board of any military device;
the loading or unloading of any commodity, currency or person contrary to the customs, fiscal, immigration or sanitary laws and regulations of the coastal State;
any act of wilful and serious pollution contrary to this Convention;
any fishing activities;
the carrying out of research or survey activities;
any act aimed at interfering with any systems of communication or any other facilities or installations of the coastal State;
any other activity not having a direct bearing on passage
So what do you think which of the above clauses were being violated?